Commit 21276379 by Mark Wielaard

Imported GNU Classpath 0.20

       Imported GNU Classpath 0.20
       * Makefile.am (AM_CPPFLAGS): Add classpath/include.
       * java/nio/charset/spi/CharsetProvider.java: New override file.
       * java/security/Security.java: Likewise.
       * sources.am: Regenerated.
       * Makefile.in: Likewise.

From-SVN: r109831
parent bcb36c3e
2006-01-16 Mark Wielaard <mark@klomp.org>
Imported GNU Classpath 0.20
* Makefile.am (AM_CPPFLAGS): Add classpath/include.
* java/nio/charset/spi/CharsetProvider.java: New override file.
* java/security/Security.java: Likewise.
* sources.am: Regenerated.
* Makefile.in: Likewise.
2006-01-17 Jakub Jelinek <jakub@redhat.com>
* configure.ac (dbexecdir): New substituted var.
......
......@@ -152,6 +152,7 @@ LIBFFIINCS = @LIBFFIINCS@
AM_CPPFLAGS = -I$(top_srcdir) \
-Iinclude -I$(top_srcdir)/include \
-I$(top_srcdir)/classpath/include \
-Iclasspath/include \
-I$(top_srcdir)/classpath/native/fdlibm \
$(GCINCS) $(THREADINCS) $(INCLTDL) \
$(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
......
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="./autogen.sh"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${build_project}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="/bin/sh"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
</launchConfiguration>
<?xml version='1.0'?>
<launchConfiguration type='org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType'><stringAttribute key='org.eclipse.debug.core.ATTR_REFRESH_SCOPE' value='${project}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS' value='full,incremental,auto,'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE' value='${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;workingSet&quot; editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/external/sax/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/external/w3c_dom/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/test/java.net/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/test/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/java-nio/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/midi-dssi/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/vmi/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/test/java.util/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/target/generic/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/lib/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/fdlibm/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/target/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/target/Linux/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/examples/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jawt/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/gtk-peer/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/classpath/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/midi-alsa/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/test/java.lang.reflect/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/test/java.io/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/external/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/xmlj/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/compat/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/qt-peer/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/vm/reference/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/java-util/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/test/gnu.java.lang.reflect/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/configure.ac&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/compat/java.net/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/include/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/java-lang/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/java-io/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/doc/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/gnu/test/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/doc/api/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/testsuite/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/java-net/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/vm/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_LOCATION' value='/bin/sh'/><booleanAttribute key='org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED' value='true'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY' value='${build_project}'/><booleanAttribute key='org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED' value='true'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS' value='./autogen.sh'/><booleanAttribute key='org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND' value='false'/><booleanAttribute key='org.eclipse.debug.core.appendEnvironmentVariables' value='true'/></launchConfiguration>
\ No newline at end of file
<?xml version='1.0'?>
<launchConfiguration type='org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType'><stringAttribute key='org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS' value='full,incremental,auto,'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE' value='${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;workingSet&quot; editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/include/Makefile&quot; type=&quot;1&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_LOCATION' value='${system_path:make}'/><booleanAttribute key='org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED' value='true'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY' value='${build_project}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS' value='-C ${build_project}/include CLASSDIR=install/share/classpath USER_CLASSLIB=../install/share/classpath all install'/><booleanAttribute key='org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND' value='false'/><booleanAttribute key='org.eclipse.debug.core.appendEnvironmentVariables' value='true'/></launchConfiguration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;workingSet&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/install/share/classpath&quot; type=&quot;2&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-cf glibj.zip META-INF java gnu org javax vm"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${build_project:install/share/classpath}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${system_path:jar}"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
</launchConfiguration>
<?xml version='1.0'?>
<launchConfiguration type='org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType'><stringAttribute key='org.eclipse.debug.core.ATTR_REFRESH_SCOPE' value='${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;working set&quot; editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native&quot; type=&quot;2&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS' value='full,incremental,'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE' value='${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;workingSet&quot; editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native&quot; type=&quot;2&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_LOCATION' value='${system_path:make}'/><booleanAttribute key='org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED' value='true'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY' value='${build_project}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS' value='-C ${build_project}/native all install'/><booleanAttribute key='org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND' value='false'/><booleanAttribute key='org.eclipse.debug.core.appendEnvironmentVariables' value='true'/></launchConfiguration>
\ No newline at end of file
<launchConfiguration type='org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType'><stringAttribute key='org.eclipse.debug.core.ATTR_REFRESH_SCOPE' value='${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;working set&quot; editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native&quot; type=&quot;2&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS' value='full,incremental,auto,'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE' value='${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;workingSet&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native&quot; type=&quot;2&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_LOCATION' value='${system_path:make}'/><booleanAttribute key='org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED' value='true'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY' value='${build_project}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS' value='-C ${build_project}/native all install'/><booleanAttribute key='org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND' value='false'/><booleanAttribute key='org.eclipse.debug.core.appendEnvironmentVariables' value='true'/></launchConfiguration>
\ No newline at end of file
<?xml version='1.0'?>
<launchConfiguration type='org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType'><stringAttribute key='org.eclipse.debug.core.ATTR_REFRESH_SCOPE' value='${project}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS' value='full,incremental,'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_LOCATION' value='${build_project}/configure'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY' value='${build_project}'/><booleanAttribute key='org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED' value='true'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS' value='--prefix=${build_project}/install'/><booleanAttribute key='org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND' value='false'/><booleanAttribute key='org.eclipse.debug.core.appendEnvironmentVariables' value='true'/></launchConfiguration>
\ No newline at end of file
<launchConfiguration type='org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType'><stringAttribute key='org.eclipse.debug.core.ATTR_REFRESH_SCOPE' value='${project}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS' value='full,incremental,auto,'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE' value='${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;workingSet&quot; editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/Makefile.in&quot; type=&quot;1&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_LOCATION' value='${build_project}/configure'/><booleanAttribute key='org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED' value='true'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY' value='${build_project}'/><booleanAttribute key='org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED' value='true'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS' value='--prefix=${build_project}/install --enable-regen-headers --enable-gtk-cairo'/><booleanAttribute key='org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND' value='false'/><booleanAttribute key='org.eclipse.debug.core.appendEnvironmentVariables' value='true'/></launchConfiguration>
\ No newline at end of file
......@@ -7,7 +7,7 @@
<buildSpec>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<triggers>auto,full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
......@@ -17,7 +17,7 @@
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<triggers>auto,full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
......@@ -37,7 +37,17 @@
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<triggers>auto,full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/ClasspathHeaders.launch</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>auto,full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
......@@ -50,6 +60,16 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>auto,full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/ClasspathJar.launch</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
......
......@@ -8,15 +8,19 @@ Lillian Angel (langel@redhat.com)
Anthony Balkissoon (abalkiss@redhat.com)
Stuart Ballard (stuart.a.ballard@gmail.com)
Mark Benvenuto (mcb54@columbia.edu)
Gary Benson (gbenson@redhat.com)
Geoff Berry (gcb@gnu.org)
James E. Blair (corvus@gnu.org)
Eric Blake (ebb9@email.byu.edu)
Sascha Brawer (brawer@acm.org)
Chris Burdess (dog@gnu.org)
David Daney (ddaney@avtrex.com)
Nic Ferrier (nferrier@tapsellferrier.co.uk)
Paul Fisher (rao@gnu.org)
David Gilbert (david.gilbert@object-refinery.com)
Anthony Green (green@redhat.com)
Jochen Hoenicke (Jochen.Hoenicke@Informatik.Uni-Oldenburg.de)
Kazumitsu Ito (kaz@maczuka.gcd.org)
Andrew John Hughes (gnu_andrew@member.fsf.org)
Brian Jones (cbj@gnu.org)
Roman Kennke (roman@kennke.org)
......@@ -25,8 +29,10 @@ John Keiser (jkeiser@iname.com)
John Leuner (jewel@debian.org)
Warren Levy (warrenl@cygnus.com)
Sven de Marothy (sven@physto.se)
Casey Marshall (csm@gnu.org)
Bryce McKinlay (bryce@waitaki.otago.ac.nz)
Audrius Meskauskas (audriusa@Bioinformatics.org)
Raif S. Naffah (raif@swiftdsl.com.au)
Aaron M. Renn (arenn@urbanophile.com)
Andrew Selkirk (aselkirk@sympatico.ca)
Christian Thalinger (twisti@complang.tuwien.ac.at)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
2006-01-16 Mark Wielaard <mark@klomp.org>
* native/fdlibm/namespace.h: Empty for gcj.
2006-01-14 Anthony Green <green@redhat.com>
* java/net/ServerSocket.java (accept): Remove bogus
security check.
(implAccept): Add FIXME comment.
2006-01-06 Tom Tromey <tromey@redhat.com>
PR libgcj/23499:
......
......@@ -10,7 +10,7 @@ ACLOCAL_AMFLAGS = -I m4 -I ../.. -I ../../config
native: lib
EXTRA_DIST = HACKING BUGS THANKYOU mauve-classpath LICENSE \
ChangeLog-2003 ChangeLog-2004 \
ChangeLog-2003 ChangeLog-2004 ChangeLog-2005 \
ChangeLog.gnujaxp.1 ChangeLog.gnujaxp.2 ChangeLog.libxmlj \
autogen.sh
......
......@@ -46,10 +46,11 @@ subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \
$(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \
$(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
......@@ -165,6 +166,7 @@ JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
JIKESENCODING = @JIKESENCODING@
JIKESWARNINGS = @JIKESWARNINGS@
KJC = @KJC@
LDFLAGS = @LDFLAGS@
LIBDEBUG = @LIBDEBUG@
......@@ -275,7 +277,7 @@ SUBDIRS = lib doc external include native resource scripts $(EXAMPLESDIR)
DIST_SUBDIRS = lib doc external include native resource scripts examples
ACLOCAL_AMFLAGS = -I m4 -I ../.. -I ../../config
EXTRA_DIST = HACKING BUGS THANKYOU mauve-classpath LICENSE \
ChangeLog-2003 ChangeLog-2004 \
ChangeLog-2003 ChangeLog-2004 ChangeLog-2005 \
ChangeLog.gnujaxp.1 ChangeLog.gnujaxp.2 ChangeLog.libxmlj \
autogen.sh
......
New in release 0.20
New in release 0.20 (Jan 13, 2006)
* New StAX pull parser and SAX-over-StAX driver. Lots of DOM, SAX/StAX,
XPath and XSLT improvements. Support for XInclude and XML Base added.
Conformance is now regularly tested against various test-suites at
http://builder.classpath.org/xml/ See also doc/README.jaxp.
* Full beans XMLEncoder implementation.
* javax.sound.sampled implementation.
* javax.print.attribute and javax.print.event implementated.
* Lots of new datatransfer, print swing and swing.text work and optimization.
* Additional 1.5 support. Including new (separate) generic branch release.
* SecurityManager cleanups and start of review of all Permission checks
(includes adding lots of new checks to the Mauve test-suite).
* Buildable on cygwin.
* Fully buildable as "in-workspace" library-plus-vm inside (native) Eclipse
see http://developer.classpath.org/mediation/ClasspathHackingWithEclipse
* Full example that shows a real world CORBA and Free Swing implementation.
See examples/gnu/classpath/examples/CORBA/swing/README.html
* A list of bug fixes can be found at:
http://gcc.gnu.org/bugzilla/buglist.cgi?product=classpath&target_milestone=0.20
Runtime interface changes:
* New method VMStackWalker.getClassLoader() was added to avoid an infinite
loop between getCallingClassLoader() and Class.getClassLoader().
* The included fdlibm implementation has seen several cleanups to handle
new architectures and namespacing issues (in particular for ppc, darwin
and non-C99 compilers). Please double check any arithmetic test against
new platforms/runtimes.
* The gnu.java.net.Plain[Datagram]Socket implementations have been
turned into VM reference classes with JNI/Posix implementations.
New in release 0.19 (Nov 2, 2005)
* The Swing RepaintManager has been reworked for more efficient painting,
......
......@@ -1090,6 +1090,7 @@ m4_include([../../libtool.m4])
m4_include([m4/acattribute.m4])
m4_include([m4/accross.m4])
m4_include([m4/acinclude.m4])
m4_include([m4/ax_create_stdint_h.m4])
m4_include([m4/iconv.m4])
m4_include([m4/lib-ld.m4])
m4_include([m4/lib-link.m4])
......
......@@ -3,7 +3,7 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
timestamp='2005-07-08'
timestamp='2005-11-11'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
......@@ -779,7 +779,7 @@ EOF
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
x86:Interix*:[34]*)
x86:Interix*:[345]*)
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
exit ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
......@@ -794,7 +794,7 @@ EOF
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit ;;
amd64:CYGWIN*:*:*)
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
p*:CYGWIN*:*)
......@@ -873,6 +873,9 @@ EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo or32-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit ;;
......@@ -1182,7 +1185,6 @@ EOF
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
*86) UNAME_PROCESSOR=i686 ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
......
......@@ -3,7 +3,7 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
timestamp='2005-07-08'
timestamp='2005-12-06'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
......@@ -171,6 +171,10 @@ case $os in
-hiux*)
os=-hiuxwe2
;;
-sco6)
os=-sco5v6
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
......@@ -187,6 +191,10 @@ case $os in
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
......@@ -257,7 +265,7 @@ case $basic_machine in
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| ms1 \
| mt \
| msp430 \
| ns16k | ns32k \
| or32 \
......@@ -287,6 +295,9 @@ case $basic_machine in
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
ms1)
basic_machine=mt-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
......@@ -336,7 +347,7 @@ case $basic_machine in
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| ms1-* \
| mt-* \
| msp430-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
......@@ -696,6 +707,9 @@ case $basic_machine in
basic_machine=i386-pc
os=-msdos
;;
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
mvs)
basic_machine=i370-ibm
os=-mvs
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,7 +6,7 @@ dnl -----------------------------------------------------------
dnl define([AC_CACHE_LOAD], )dnl
dnl define([AC_CACHE_SAVE], )dnl
AC_INIT([GNU Classpath],[0.20-pre],[classpath@gnu.org],[classpath])
AC_INIT([GNU Classpath],[0.20],[classpath@gnu.org],[classpath])
AC_CONFIG_SRCDIR(java/lang/System.java)
AC_CANONICAL_TARGET
......@@ -274,7 +274,8 @@ if test "x${COMPILE_JNI}" = xyes; then
localtime_r \
strerror_r \
fcntl \
mmap munmap mincore msync madvise getpagesize sysconf])
mmap munmap mincore msync madvise getpagesize sysconf \
isnan])
AC_HEADER_TIME
AC_STRUCT_TM
......@@ -370,7 +371,7 @@ if test "x${COMPILE_JNI}" = xyes; then
dnl Check for AWT related Qt4
if test "x${COMPILE_QT_PEER}" = xyes; then
PKG_CHECK_MODULES(QT, QtGui >= 4.0.1, HAVE_QT4="yes", HAVE_QT4="no")
PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
if test "x$HAVE_QT4" = "xyes"; then
dnl Check needed because in some cases the QtGui includedir
dnl doesn't contain the subsystem dir.
......@@ -560,6 +561,8 @@ AC_ARG_ENABLE([portable-native-sync],
esac],
[])
AX_CREATE_STDINT_H([include/config-int.h])
dnl -----------------------------------------------------------
dnl output files
dnl -----------------------------------------------------------
......
......@@ -41,10 +41,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in texinfo.tex
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \
$(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \
$(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
......@@ -149,6 +150,7 @@ JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
JIKESENCODING = @JIKESENCODING@
JIKESWARNINGS = @JIKESWARNINGS@
KJC = @KJC@
LDFLAGS = @LDFLAGS@
LIBDEBUG = @LIBDEBUG@
......
......@@ -17,7 +17,7 @@ PACKAGES
. gnu.xml.xpath.* ... JAXP XPath implementation
. gnu.xml.transform.* ... JAXP XSL transformer implementation
. gnu.xml.pipeline.* ... SAX2 event pipeline support
. gnu.xml.stream.* ... StAX pull parser implementation
. gnu.xml.stream.* ... StAX pull parser and SAX-over-StAX driver
. gnu.xml.util.* ... various XML utility classes
. gnu.xml.libxmlj.dom.* ... libxmlj DOM Level 3 Core and XPath
. gnu.xml.libxmlj.sax.* ... libxmlj SAX parser
......@@ -139,6 +139,9 @@ To enable the various GNU JAXP factories, set the following system properties
-Djavax.xml.stream.XMLInputFactory=gnu.xml.stream.XMLInputFactoryImpl
-Djavax.xml.stream.XMLOutputFactory=gnu.xml.stream.XMLOutputFactoryImpl
GNU SAX-over-StAX:
-Djavax.xml.parsers.SAXParserFactory=gnu.xml.stream.SAXParserFactory
libxmlj SAX:
-Djavax.xml.parsers.SAXParserFactory=gnu.xml.libxmlj.sax.GnomeSAXParserFactory
......
......@@ -42,10 +42,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \
$(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \
$(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
......@@ -142,6 +143,7 @@ JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
JIKESENCODING = @JIKESENCODING@
JIKESWARNINGS = @JIKESWARNINGS@
KJC = @KJC@
LDFLAGS = @LDFLAGS@
LIBDEBUG = @LIBDEBUG@
......
......@@ -83,6 +83,11 @@ Programming Standards
Working on the code, Working with others
* Branches::
* Writing ChangeLogs::
Working with branches
* Writing ChangeLogs::
Programming Goals
......@@ -493,7 +498,7 @@ The following lists how code is formatted (and some other code
conventions):
@itemize
@itemize @bullet
@item
Java source files in GNU Classpath are encoded using UTF-8. However,
......@@ -689,7 +694,7 @@ fail to compile the offending source code.
Some things are the same as in the normal GNU Coding Standards:
@itemize
@itemize @bullet
@item
Unnecessary braces can be removed, one line after an if, for, while as
......@@ -807,10 +812,70 @@ followed to be the most productive they can be (given the above
constraints).
@menu
* Branches::
* Writing ChangeLogs::
@end menu
@node Branches, Writing ChangeLogs, Hacking Code, Hacking Code
@comment node-name, next, previous, up
@section Working with branches
Sometimes it is necessary to create branch of the source for doing new
work that is disruptive to the other hackers, or that needs new
language or libraries not yet (easily) available.
After discussing the need for a branch on the main mailinglist with
the other hackers explaining the need of a branch and suggestion of
the particular branch rules (what will be done on the branch, who will
work on it, will there be different commit guidelines then for the
mainline trunk and when is the branch estimated to be finished and
merged back into the trunk) every GNU Classpath hacker with commit
access should feel free to create a branch. There are however a couple
of rules that every branch should follow:
@itemize @bullet
@item All branches ought to be documented in the developer wiki at
@uref{http://developer.classpath.org/mediation/ClasspathBranches}, so
we can know which are live, who owns them, and when they die.
@item Some rules can be changed on a branch. In particular the branch
maintainer can change the review requirements, and the requirement of
keeping things building, testing, etc, can also be lifted. (These
should be documented along with the branch name and owner if they
differ from the trunk.)
@item Requirements for patch email to classpath-patches and for paperwork
@strong{cannot} be lifted. See @ref{Requirements}.
@item A branch should not be seen as ``private'' or
``may be completely broken''. It should be as much as possible
something that you work on with a team (and if there is no team - yet
- then there is nothing as bad as having a completely broken build to
get others to help out). There can of course be occasional breakage, but
it should be planned and explained. And you can certainly have a rule
like ``please ask me before committing to this branch''.
@item Merges from the trunk to a branch are at the discretion of the
branch maintainer.
@item A merge from a branch to the trunk is treated like any other patch.
In particular, it has to go through review, it must satisfy all the
trunk requirements (build, regression test, documentation).
@item There may be additional timing requirements on merging a branch to
the trunk depending on the release schedule, etc. For instance we may
not want to do a branch merge just before a release.
@end itemize
If any of these rules are unclear please discuss on the list first.
@menu
* Writing ChangeLogs::
@end menu
@node Writing ChangeLogs, , Hacking Code, Hacking Code
@node Writing ChangeLogs, , Branches, Hacking Code
@comment node-name, next, previous, up
@section Documenting what changed when with ChangeLog entries
......@@ -828,7 +893,7 @@ A good ChangeLog entry guideline can be found in the Guile Manual at
Here are some example to explain what should or shouldn't be in a
ChangeLog entry (and the corresponding commit message):
@itemize
@itemize @bullet
@item
The first line of a ChangeLog entry should be:
......
......@@ -226,6 +226,7 @@ become operable.
* java.lang.VMRuntime::
* java.lang.VMString::
* java.lang.VMThread::
* java.lang.VMInstrumentationImpl::
@end menu
@node java.lang.VMClass, java.lang.VMObject ,java.lang,java.lang
......@@ -607,7 +608,7 @@ A new mapping is created for each new string being @code{intern}ed.
A VM may implement this differently by implementing this method,
which is @code{static} and the only one in @code{VMString}.
@node java.lang.VMThread,, java.lang.VMString, java.lang
@node java.lang.VMThread,java.lang.VMInstrumentationImpl, java.lang.VMString, java.lang
@subsection @code{java.lang.VMThread}
@code{VMThread} provides the link between Java's threads and the platform
......@@ -683,6 +684,45 @@ having returned true, and is thus deprecated as a result.
@end itemize
@end itemize
@node java.lang.VMInstrumentationImpl,, java.lang.VMThread, java.lang
@subsection @code{java.lang.VMInstrumentationImpl}
The @code{java.lang.VMInstrumentationImpl} and
@code{java.lang.InstrumentationImpl} provides an implementation of the
@code{java.lang.instrument.Instrument} interface. This interface is for java
1.5 and is only in the generics branch.
A @code{InstrumentationImpl} object should be given to any agent
given in the command line (see the @code{java.lang.instrument} package
documentation). A VM has to implement the static native methods of the
@code{VMInstrumentationImpl} class.
@itemize @bullet
@item @code{isRedefineClassesSupported()} -- Returns true if the JVM supports
class redefinition.
@item @code{redefineClasses()} -- Gives a set of classes with new bytecodes.
The VM must redefine the classes by reading the new bytecodes.
@item @code{getAllLoadedClass()} -- Returns an array of all loaded classes.
@item @code{getInitiatedClass()} -- Returns an array of all classes loaded
by a specific class loader.
@item @code{getObjectSize()} -- Gives the size of an object.
@end itemize
When agents are defined, the VM has to call transformers of the
@code{InstrumentImpl} object each time a class is loaded, eg a call to
@code{VMClassLoader.defineClass}. The @code{InstrumentationImpl} class defines
a method that has to be called before reading a class file in the VM.
@itemize @bullet
@item @code{callTransformers} -- Calls each transformer registered to
the @code{InstrumentationImpl} object and returns a new bytecode file.
@end itemize
No default implementation is provided in gnu classpath for the
@code{VMInstrumentationImpl} methods. A default implementation will perhaps
be written, but it might break the @code{ClassLoader/VMClassLoader} interface
for calling the @code{InstrumentationImpl.callTransformers} when a class byte
code is defined with @code{ClassLoader.defineClass}.
@node gnu.classpath, java.util, java.lang, Classpath Hooks
@section @code{gnu.classpath}
......
......@@ -9,11 +9,7 @@
<boxitem>
<strong>Upcoming Events:</strong><br>
<ul>
<li>[1-5 Aug 2005] <a href="http://conferences.oreillynet.com/os2005/">OSCON</a>, Portland, Oregon - USA
<ul>
<li><a href="http://conferences.oreillynet.com/cs/os2005/view/e_sess/6730">The State of Free JVMs</a>
Tom Tromey</li>
</ul>
<li>[25+26 Feb. 2006] FOSDEM'06 in Brussels, Belgium. [<createlink name="GNU Classpath and friends" url="events/fosdem06.html">]</li>
</ul>
</boxitem>
......@@ -22,6 +18,13 @@ Tom Tromey</li>
<ul>
<li>
[1-5 Aug 2005] <a href="http://conferences.oreillynet.com/os2005/">OSCON</a>, Portland, Oregon - USA
<ul>
<li><a href="http://conferences.oreillynet.com/cs/os2005/view/e_sess/6730">The State of Free JVMs</a>
Tom Tromey</li>
</ul>
<li>
[29-31 May 2005] <a href="http://2005.guadec.org/">Guadec</a>, Stuttgart - Germany
<ul>
<li><a href="http://2005.guadec.org/schedule/gnometalks.html#eclipseyou">The Eclipse IDE and you</a>
......
#!wml --include=..
#include "include/layout.wml"
<set-var last-modified-author="mjw">
<subject "GNU Classpath and friends @ Fosdem 2006">
<box>
<boxitem>
<h2>GNU Classpath and friends meeting during Fosdem 2006</h2>
<i>Fosdem, Saturday/Sunday 25/26 February 2006, Brussels, Belgium</i>
<p>
The various free software library, runtimes, compiler and tool
projects around GNU Classpath will meet in Brussel to discuss what has
happened in the last year in the Free Software community and what the
next year will bring us during Fosdem.
<p>
The 6th edition of FOSDEM (Free and Opensource Software Developers'
European Meeting) will take place on February 25+26 2006 in Brussels
(Belgium), at the Solbosch Campus of the ULB (Free University of
Brussels). FOSDEM is a free and non-commercial event for the community
and organized by the community.
See <a href="http://www.fosdem.org/">http://www.fosdem.org/</a>.
</boxitem>
<boxitem>
<h3>Saturday from 13:00 to 17:00 - "End-User talks"</h3>
<p>
Presentations that show what cool stuff can be done with the Free
Stack right now.
</p>
<p>
<b>Putting the 'Free' into JFreeChart</b>
<i>Dave Gilbert, JFreeChart Project Leader</i>
<p>
A review of the efforts to make JFreeChart work with GNU
Classpath-based runtimes, including a brief history, a demonstration
of the current state (using the java bindings for Cairo), and an
overview of the work that remains to be done.
</p>
</p>
<p>
<b>Using Eclipse for GNU Classpath development</b>
<i>Tom Tromey</i>
<p>
Learn how to setup a fully working development environment based
on GNU Classpath in Eclipse that can be used to bootstrap the full
free toolchain (and can be used to run Eclipse itself) in just 10
minutes.
</p>
</p>
<p>
<b>Eclipse RCP and GCJ/GIJ</b>
<i>Wayne Beaton</i>
<p>
Eclipse Rich Client Platform (RCP) is a runtime platform for
delivering your Java applications on multiple platforms. RCP is far
more than just a windowing toolkit; it is rich client "middleware"
that provides a comprehensive framework for building and deploying
applications that are modular, extensible, and updatable. The kinds
of applications you can build with Eclipse RCP are limited only by
your imagination. During this talk, we will discuss how the Eclipse
RCP can be used in conjunction with the Eclipse Eco-system and
GCJ/GIJ to build high quality applications.
</p>
</p>
<p>
</boxitem>
<boxitem>
<h3>Sunday from 09:00 to 13:00 - "Developer talks"</h3>
<p>
Presentations of (core) libraries and runtimes that are in progress,
made a lot of progress in the last year and are in active development.
</p>
<p>
<b>Free Swing, past, present and future</b>
<i>Roman Kennke</i>
<p>
An overview of that state of Free Swing one year ago, what has been
done in the meantime, what still must be done and which applications
work now.
</p>
</p>
<p>
<b>The Free CORBA comes</b>
<i>Dr Audrius Meskauskas</i>
<p>
If the Free world does not want to step back in the battle, we need
a complete set of the Free tools for advanced communication over
the network. For our CORBA implementation we needed:
<p>
<ol>
<li> Free. No classes with restricted license.
<li> Fully workable, interoperable and pass tests, recognized by
the CORBA user community as serious (we needed to find a well
known Free testing suite).
<li> Properly commented, being ready for the long life in the Free
world.
<li> No pressure to use the outdated approaches.
CORBA 3.0.3 and jdk 1.5.
</ol>
<p>
To reach these goals, we have chosen for implementing a clean room
implementation, using the published standard specifications only.
During the recent year of the GNU Classpath development, this goal
is in large degree achieved. The important directions of future
development could be providing features that are outside the scope
of the both CORBA standard and Sun API, but included in the near all
proprietary implementations (SSH, HTTP and other bridges, get rid of
rmic code generator for RMI/IIOP, fault tolerant behavior, reduced
the footprint and others).
</p>
</p>
<p>
<b>The JamVM runtime</b>
<i>Robert Lougher</i>
<p>
An overview of the JamVM virtual machine, with comparisons to other
GNU Classpath runtimes, and a section on the VM interface.
</p>
</p>
<p>
<b>Integrating Vmgen-based interpreters</b>
<i>Christian Thalinger</i>
<p>
Vmgen is a tool for writing efficient interpreters. The Cacao
runtime recently added a Vmgen based interpreter in addition to
the JIT engine.
</p>
</p>
<p>
<boxitem>
<boxitem>
<h3>Sunday from 14:00 to 17:30 - "The Future"</h3>
<p>
Interactive technical hacker discussions on how to integrate
the projects more and move forward in the next year.
</p>
<p>
<b>State of the world, beyond japi</b>
<i>Mark Wielaard, GNU Classpath Maintainer</i>
<p>
After a short overview of the various free stacks, libraries,
compilers, tools and runtimes this session is mostly open discussion
about what work remains to be done and how to integrate the various
efforts better. Ideas for work items welcome.
</p>
</p>
<p>
</boxitem>
<boxitem>
<b>Additional Resources:</b>
<ul>
<li><createlink name="Free But Shackled - The Java Trap"
url="http://www.gnu.org/philosophy/java-trap.html">
(by Richard Stallman)
</li>
<li><createlink name="Escaping the Java Trap: A practical road map to the Free Software and Open Source alternatives"
url="http://developer.classpath.org/support/">
</li>
</ul>
<p>
</boxitem>
<boxitem>
<b>Official links:</b>
<ul>
<li><createlink name="FOSDEM Homepage"
url="http://www.fosdem.org/">
</li>
</ul>
</boxitem>
</box>
<newsitem date="25/26 Feb 2006">
<createlink name="GNU Classpath and friends meeting during Fosdem 2006"
url="events/fosdem06.html">
</newsitem>
<newsitem date="02 Nov 2005">
<createlink name="GNU Classpath 0.19"
url="announce/20051102.html">
......
......@@ -53,25 +53,25 @@ install-data-local:
for file in $(ALL_EXAMPLE_FILES); do \
f=`echo $$file | cut -c$$srcdir_cnt-`; \
fdir=`dirname $$f`; \
if test ! -d $(DESTDIR)/$(pkgdatadir)/examples/$$fdir; then \
echo "$(mkinstalldirs) $(DESTDIR)/$(pkgdatadir)/examples/$$fdir"; \
$(mkinstalldirs) $(DESTDIR)/$(pkgdatadir)/examples/$$fdir; \
if test ! -d $(DESTDIR)$(pkgdatadir)/examples/$$fdir; then \
echo "$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/examples/$$fdir"; \
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/examples/$$fdir; \
fi; \
echo "$(INSTALL_DATA) $$file $(DESTDIR)/$(pkgdatadir)/examples/$$f"; \
$(INSTALL_DATA) $$file $(DESTDIR)/$(pkgdatadir)/examples/$$f; \
echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/examples/$$f"; \
$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/examples/$$f; \
done
echo "$(INSTALL_DATA) Makefile.jawt $(DESTDIR)/$(pkgdatadir)/examples/"
$(INSTALL_DATA) Makefile.jawt $(DESTDIR)/$(pkgdatadir)/examples/
echo "$(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/examples/"
$(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/examples/
uninstall-local:
srcdir_cnt=`echo $(srcdir) | wc -c`; \
for file in $(ALL_EXAMPLE_FILES); do \
f=`echo $$file | cut -c$$srcdir_cnt-`; \
echo "rm -f $(DESTDIR)/$(pkgdatadir)/examples/$$f"; \
rm -f $(DESTDIR)/$(pkgdatadir)/examples/$$f; \
echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/$$f"; \
rm -f $(DESTDIR)$(pkgdatadir)/examples/$$f; \
done
echo "rm -f $(DESTDIR)/$(pkgdatadir)/examples/Makefile.jawt"
rm -f $(DESTDIR)/$(pkgdatadir)/examples/Makefile.jawt
echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.jawt"
rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.jawt
# Make sure everything is included in the distribution.
EXTRA_DIST = README Makefile.jawt.in
......
......@@ -43,10 +43,11 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \
$(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \
$(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
......@@ -151,6 +152,7 @@ JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
JIKESENCODING = @JIKESENCODING@
JIKESWARNINGS = @JIKESWARNINGS@
KJC = @KJC@
LDFLAGS = @LDFLAGS@
LIBDEBUG = @LIBDEBUG@
......@@ -491,25 +493,25 @@ install-data-local:
for file in $(ALL_EXAMPLE_FILES); do \
f=`echo $$file | cut -c$$srcdir_cnt-`; \
fdir=`dirname $$f`; \
if test ! -d $(DESTDIR)/$(pkgdatadir)/examples/$$fdir; then \
echo "$(mkinstalldirs) $(DESTDIR)/$(pkgdatadir)/examples/$$fdir"; \
$(mkinstalldirs) $(DESTDIR)/$(pkgdatadir)/examples/$$fdir; \
if test ! -d $(DESTDIR)$(pkgdatadir)/examples/$$fdir; then \
echo "$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/examples/$$fdir"; \
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/examples/$$fdir; \
fi; \
echo "$(INSTALL_DATA) $$file $(DESTDIR)/$(pkgdatadir)/examples/$$f"; \
$(INSTALL_DATA) $$file $(DESTDIR)/$(pkgdatadir)/examples/$$f; \
echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/examples/$$f"; \
$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/examples/$$f; \
done
echo "$(INSTALL_DATA) Makefile.jawt $(DESTDIR)/$(pkgdatadir)/examples/"
$(INSTALL_DATA) Makefile.jawt $(DESTDIR)/$(pkgdatadir)/examples/
echo "$(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/examples/"
$(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/examples/
uninstall-local:
srcdir_cnt=`echo $(srcdir) | wc -c`; \
for file in $(ALL_EXAMPLE_FILES); do \
f=`echo $$file | cut -c$$srcdir_cnt-`; \
echo "rm -f $(DESTDIR)/$(pkgdatadir)/examples/$$f"; \
rm -f $(DESTDIR)/$(pkgdatadir)/examples/$$f; \
echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/$$f"; \
rm -f $(DESTDIR)$(pkgdatadir)/examples/$$f; \
done
echo "rm -f $(DESTDIR)/$(pkgdatadir)/examples/Makefile.jawt"
rm -f $(DESTDIR)/$(pkgdatadir)/examples/Makefile.jawt
echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.jawt"
rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.jawt
dist-hook:
srcdir_cnt=`echo $(srcdir) | wc -c`; \
for file in $(ALL_EXAMPLE_FILES); do \
......
......@@ -41,10 +41,11 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \
$(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \
$(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
......@@ -149,6 +150,7 @@ JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
JIKESENCODING = @JIKESENCODING@
JIKESWARNINGS = @JIKESWARNINGS@
KJC = @KJC@
LDFLAGS = @LDFLAGS@
LIBDEBUG = @LIBDEBUG@
......
......@@ -41,10 +41,11 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \
$(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \
$(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
......@@ -140,6 +141,7 @@ JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
JIKESENCODING = @JIKESENCODING@
JIKESWARNINGS = @JIKESWARNINGS@
KJC = @KJC@
LDFLAGS = @LDFLAGS@
LIBDEBUG = @LIBDEBUG@
......
......@@ -41,10 +41,11 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \
$(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \
$(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
......@@ -140,6 +141,7 @@ JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
JIKESENCODING = @JIKESENCODING@
JIKESWARNINGS = @JIKESWARNINGS@
KJC = @KJC@
LDFLAGS = @LDFLAGS@
LIBDEBUG = @LIBDEBUG@
......
......@@ -40,6 +40,8 @@ package gnu.CORBA.Poa;
import gnu.CORBA.ByteArrayComparator;
import org.omg.CORBA.portable.Delegate;
import org.omg.CORBA.portable.ObjectImpl;
import org.omg.PortableServer.Servant;
import java.util.Iterator;
......@@ -66,7 +68,7 @@ public class AOM
/**
* Create an initialised instance.
*/
Obj(org.omg.CORBA.Object _object, byte[] _key, Servant _servant, gnuPOA _poa)
Obj(gnuServantObject _object, byte[] _key, Servant _servant, gnuPOA _poa)
{
object = _object;
key = _key;
......@@ -77,7 +79,7 @@ public class AOM
/**
* The object.
*/
public final org.omg.CORBA.Object object;
public final gnuServantObject object;
/**
* The servant, serving the given object.
......@@ -158,14 +160,13 @@ public class AOM
Map objects = new TreeMap(new ByteArrayComparator());
/**
* Get the record of the stored object. If the object is mapped
* several times under the different keys, one of the mappings
* is used.
*
* Get the record of the stored object. If the object is mapped several times
* under the different keys, one of the mappings is used.
*
* @param object the stored object
*
* @return the record about the stored object, null if
* this object is not stored here.
*
* @return the record about the stored object, null if this object is not
* stored here.
*/
public Obj findObject(org.omg.CORBA.Object stored_object)
{
......@@ -173,9 +174,33 @@ public class AOM
return null;
Map.Entry item;
Iterator iter = objects.entrySet().iterator();
Iterator iter;
Obj ref;
if (stored_object instanceof ObjectImpl)
{
// If the delegate is available, search by delegate.
Delegate d = ((ObjectImpl) stored_object)._get_delegate();
Delegate d2;
if (d != null)
{
iter = objects.entrySet().iterator();
while (iter.hasNext())
{
item = (Map.Entry) iter.next();
ref = (Obj) item.getValue();
d2 = ref.object._get_delegate();
if (d == d2 || (d2 != null && d2.equals(d)))
return ref;
}
}
}
// For other objects (or if not possible to get the delegate),
// search by .equals
iter = objects.entrySet().iterator();
while (iter.hasNext())
{
item = (Map.Entry) iter.next();
......@@ -187,12 +212,11 @@ public class AOM
}
/**
* Find the reference info for the given servant.
* If the servant is mapped to several objects, this
* returns the first found occurence.
*
* Find the reference info for the given servant. If the servant is mapped to
* several objects, this returns the first found occurence.
*
* @param servant a servant to find.
*
*
* @return the servant/object/POA binding or null if no such found.
*/
public Obj findServant(Servant servant)
......@@ -257,7 +281,7 @@ public class AOM
*
* @return the newly created object record.
*/
public Obj add(org.omg.CORBA.Object object, Servant servant, gnuPOA poa)
public Obj add(gnuServantObject object, Servant servant, gnuPOA poa)
{
return add(generateObjectKey(object), object, servant, poa);
}
......@@ -270,7 +294,7 @@ public class AOM
* @param servant a servant, serving the given object.
* @param poa the POA, where the object is connected.
*/
public Obj add(byte[] key, org.omg.CORBA.Object object, Servant servant,
public Obj add(byte[] key, gnuServantObject object, Servant servant,
gnuPOA poa
)
{
......
......@@ -1052,12 +1052,12 @@ public class gnuPOA
/**
* Returns the servant that is serving this object.
*
* @return if the RETAIN policy applies and the object is in the Active
* Object Map, the method returns the servant, associated with this object.
*
* @return if the RETAIN policy applies and the object is in the Active Object
* Map, the method returns the servant, associated with this object.
* Otherwise, if the USE_DEFAULT_SERVANT policy applies, the method returns
* the default servant (if one was set).
*
*
* @throws ObjectNotActive if none of the conditions above are satisfied.
* @throws WrongAdapter if the object reference was not created with this POA.
* @throws WrongPolicy. This method requires either RETAIN or
......@@ -1065,14 +1065,26 @@ public class gnuPOA
* apply to this POA.
*/
public Servant reference_to_servant(org.omg.CORBA.Object the_Object)
throws ObjectNotActive, WrongPolicy,
WrongAdapter
throws ObjectNotActive, WrongPolicy, WrongAdapter
{
if (applies(ServantRetentionPolicyValue.RETAIN))
{
AOM.Obj ref = aom.findObject(the_Object);
if (ref == null)
throw new WrongAdapter();
{
String object;
if (the_Object == null)
object = "null passed";
else if (the_Object instanceof gnuServantObject)
{
gnuServantObject gs = (gnuServantObject) the_Object;
object = "Wrong owner POA " + gs.poa.the_name();
}
else
object = "Unknown " + the_Object.getClass().getName();
throw new WrongAdapter(object + " for '" + the_name() + "'");
}
else if (ref.isDeactiveted() || ref.servant == null)
{
if (default_servant != null)
......@@ -1092,32 +1104,30 @@ public class gnuPOA
}
/**
* Returns the id of the object, served by the given servant
* (assuming that the servant serves only one object).
* The id is found in one of the following ways.
* <ul>
* <li>If the POA has both the RETAIN and the UNIQUE_ID policy and
* the specified servant is active, the method return the Object Id associated
* with that servant.
* </li><li>
* 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
* inactive, the method activates the servant using a POA-generated Object Id
* and the Interface Id associated with the servant, and returns that
* Object Id.
* </li>
* <li>If the POA has the USE_DEFAULT_SERVANT policy, the servant specified
* is the default servant, and the method is being invoked in the context of
* executing a request on the default servant, the method returns the
* ObjectId associated with the current invocation.
* </li>
* </ul>
* @throws ServantNotActive in all cases, not listed in the list above.
* @throws WrongPolicy The method requres USE_DEFAULT_SERVANT policy or
* a combination of the RETAIN policy and either the UNIQUE_ID or
* IMPLICIT_ACTIVATION policies and throws the WrongPolicy if these conditions
* are not satisfied.
*/
* Returns the id of the object, served by the given servant (assuming that
* the servant serves only one object). The id is found in one of the
* following ways.
* <ul>
* <li>If the POA has both the RETAIN and the UNIQUE_ID policy and the
* specified servant is active, the method return the Object Id associated
* with that servant. </li>
* <li> 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
* inactive, the method activates the servant using a POA-generated Object Id
* and the Interface Id associated with the servant, and returns that Object
* Id. </li>
* <li>If the POA has the USE_DEFAULT_SERVANT policy, the servant specified
* is the default servant, and the method is being invoked in the context of
* executing a request on the default servant, the method returns the ObjectId
* associated with the current invocation. </li>
* </ul>
*
* @throws ServantNotActive in all cases, not listed in the list above.
* @throws WrongPolicy The method requres USE_DEFAULT_SERVANT policy or a
* combination of the RETAIN policy and either the UNIQUE_ID or
* IMPLICIT_ACTIVATION policies and throws the WrongPolicy if these conditions
* are not satisfied.
*/
public byte[] servant_to_id(Servant the_Servant)
throws ServantNotActive, WrongPolicy
{
......
......@@ -42,6 +42,7 @@ package gnu.classpath.jdwp;
import gnu.classpath.jdwp.event.Event;
import gnu.classpath.jdwp.event.EventManager;
import gnu.classpath.jdwp.event.EventRequest;
import gnu.classpath.jdwp.exception.JdwpException;
import gnu.classpath.jdwp.id.ThreadId;
import gnu.classpath.jdwp.processor.PacketProcessor;
import gnu.classpath.jdwp.transport.ITransport;
......@@ -206,7 +207,20 @@ public class Jdwp
EventManager em = EventManager.getDefault ();
EventRequest request = em.getEventRequest (event);
if (request != null)
sendEvent (request, event);
{
try
{
System.out.println ("Jdwp.notify: sending event " + event);
sendEvent (request, event);
jdwp._enforceSuspendPolicy (request.getSuspendPolicy ());
}
catch (Exception e)
{
/* Really not much we can do. For now, just print out
a warning to the user. */
System.out.println ("Jdwp.notify: caught exception: " + e);
}
}
}
}
......@@ -217,32 +231,25 @@ public class Jdwp
*
* @param request the debugger request for the event
* @param event the event to send
* @throws IOException if a communications failure occurs
*/
public static void sendEvent (EventRequest request, Event event)
throws IOException
{
Jdwp jdwp = getDefault ();
if (jdwp != null)
{
try
{
// !! May need to implement send queue?
synchronized (jdwp._connection)
{
jdwp._connection.sendEvent (request, event);
}
// Follow suspend policy
jdwp._enforceSuspendPolicy (request.getSuspendPolicy ());
}
catch (IOException ie)
// !! May need to implement send queue?
synchronized (jdwp._connection)
{
System.out.println ("Jdwp.notify: caught exception: " + ie);
jdwp._connection.sendEvent (request, event);
}
}
}
// Helper function to enforce suspend policies on event notification
private void _enforceSuspendPolicy (byte suspendPolicy)
throws JdwpException
{
switch (suspendPolicy)
{
......
......@@ -41,6 +41,7 @@ package gnu.classpath.jdwp.event;
import gnu.classpath.jdwp.VMVirtualMachine;
import gnu.classpath.jdwp.exception.InvalidEventTypeException;
import gnu.classpath.jdwp.exception.JdwpException;
import java.util.Collection;
import java.util.Hashtable;
......@@ -133,7 +134,7 @@ public class EventManager
EventRequest.EVENT_VM_DEATH,
EventRequest.SUSPEND_NONE));
}
catch (InvalidEventTypeException e)
catch (JdwpException e)
{
// This can't happen
}
......@@ -187,9 +188,10 @@ public class EventManager
*
* @param request the request to monitor
* @throws InvalidEventTypeException for invalid event kind
* @throws JdwpException for other errors involving request
*/
public void requestEvent (EventRequest request)
throws InvalidEventTypeException
throws JdwpException
{
// Add request to request list
Hashtable requests;
......@@ -212,8 +214,10 @@ public class EventManager
* @param kind the event kind
* @param id the ID of the request to delete
* @throws IllegalArgumentException for invalid event kind
* @throws JdwpException for other errors deleting request
*/
public void deleteRequest (byte kind, int id)
throws JdwpException
{
Hashtable requests;
requests = (Hashtable) _requests.get (new Byte (kind));
......@@ -237,8 +241,10 @@ public class EventManager
*
* @param kind the event kind
* @throws IllegalArgumentException for invalid event kind
* @throws JdwpException for error clearing events
*/
public void clearRequests (byte kind)
throws JdwpException
{
Hashtable requests = (Hashtable) _requests.get (new Byte (kind));
if (requests == null)
......
......@@ -40,6 +40,8 @@ package gnu.java.awt.image;
import java.awt.image.ImageConsumer;
import java.awt.image.ImageProducer;
import java.io.ByteArrayInputStream;
import java.io.DataInput;
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
......@@ -55,6 +57,7 @@ public abstract class ImageDecoder implements ImageProducer
int offset;
int length;
InputStream input;
DataInput datainput;
static
{
......@@ -79,6 +82,11 @@ public abstract class ImageDecoder implements ImageProducer
this.input = is;
}
public ImageDecoder (DataInput datainput)
{
this.datainput = datainput;
}
public ImageDecoder (byte[] imagedata, int imageoffset, int imagelength)
{
data = imagedata;
......@@ -119,6 +127,8 @@ public abstract class ImageDecoder implements ImageProducer
{
if (url != null)
input = url.openStream();
else if (datainput != null)
input = new DataInputStreamWrapper(datainput);
else
{
if (filename != null)
......@@ -153,4 +163,26 @@ public abstract class ImageDecoder implements ImageProducer
}
public abstract void produce (Vector v, InputStream is) throws IOException;
private static class DataInputStreamWrapper extends InputStream
{
private final DataInput datainput;
DataInputStreamWrapper(DataInput datainput)
{
this.datainput = datainput;
}
public int read() throws IOException
{
try
{
return datainput.readByte() & 0xFF;
}
catch (EOFException eofe)
{
return -1;
}
}
}
}
......@@ -48,7 +48,6 @@ import java.awt.Graphics;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.SystemColor;
import java.awt.image.ImageObserver;
import java.text.AttributedCharacterIterator;
......@@ -81,18 +80,23 @@ public class GdkGraphics extends Graphics
native void initStateUnlocked (GtkComponentPeer component);
native void initState (int width, int height);
native void initFromImage (GtkImage image);
native void copyState (GdkGraphics g);
native void nativeCopyState (GdkGraphics g);
/**
* A cached instance that is used by {@link #create} in order to avoid
* massive allocation of graphics contexts.
*/
GdkGraphics cached = null;
/**
* A link to the parent context. This is used in {@link #dispose} to put
* this graphics context into the cache.
*/
GdkGraphics parent = null;
GdkGraphics (GdkGraphics g)
{
color = g.color;
xorColor = g.xorColor;
font = g.font;
if (font == null)
font = new Font ("Dialog", Font.PLAIN, 12);
clip = new Rectangle (g.clip);
component = g.component;
parent = g;
copyState (g);
}
......@@ -162,12 +166,54 @@ public class GdkGraphics extends Graphics
public native void copyArea(int x, int y, int width, int height,
int dx, int dy);
public Graphics create ()
/**
* Creates a copy of this GdkGraphics instance. This implementation can
* reuse a cached instance to avoid massive instantiation of Graphics objects
* during painting.
*
* @return a copy of this graphics context
*/
public Graphics create()
{
GdkGraphics copy = cached;
if (copy == null)
copy = new GdkGraphics(this);
else
{
copy.copyState(this);
cached = null;
}
return copy;
}
public native void nativeDispose();
/**
* Disposes this graphics object. This puts this graphics context into the
* cache of its parent graphics if there is one.
*/
public void dispose()
{
return new GdkGraphics (this);
if (parent != null)
{
parent.cached = this;
parent = null;
}
else
nativeDispose();
}
public native void dispose();
/**
* This is called when this object gets finalized by the garbage collector.
* In addition to {@link Graphics#finalize()} this calls nativeDispose() to
* make sure the native resources are freed before the graphics context is
* thrown away.
*/
public void finalize()
{
super.finalize();
nativeDispose();
}
public boolean drawImage (Image img, int x, int y,
Color bgcolor, ImageObserver observer)
......@@ -248,9 +294,8 @@ public class GdkGraphics extends Graphics
public void drawString (String str, int x, int y)
{
drawString(getFontPeer(), str, x, y);
}
}
public void drawString (AttributedCharacterIterator ci, int x, int y)
{
throw new Error ("not implemented");
......@@ -419,4 +464,23 @@ public class GdkGraphics extends Graphics
translateNative (x, y);
}
/**
* Copies over the state of another GdkGraphics to this instance. This is
* used by the {@link #GdkGraphics(GdkGraphics)} constructor and the
* {@link #create()} method.
*
* @param g the GdkGraphics object to copy the state from
*/
private void copyState(GdkGraphics g)
{
color = g.color;
xorColor = g.xorColor;
font = g.font;
if (font == null)
font = new Font ("Dialog", Font.PLAIN, 12);
clip = new Rectangle (g.clip);
component = g.component;
nativeCopyState(g);
}
}
......@@ -180,11 +180,14 @@ public class GdkGraphics2D extends Graphics2D
else
fg = new Color(g.fg.getRGB());
if (g.bg.getAlpha() != -1)
bg = new Color(g.bg.getRed(), g.bg.getGreen(), g.bg.getBlue(),
g.bg.getAlpha());
else
bg = new Color(g.bg.getRGB());
if (g.bg != null)
{
if (g.bg.getAlpha() != -1)
bg = new Color(g.bg.getRed(), g.bg.getGreen(), g.bg.getBlue(),
g.bg.getAlpha());
else
bg = new Color(g.bg.getRGB());
}
if (g.clip == null)
clip = null;
......@@ -1088,6 +1091,8 @@ public class GdkGraphics2D extends Graphics2D
public void setBackground(Color c)
{
if (c == null)
c = Color.WHITE;
bg = c;
}
......
......@@ -47,6 +47,7 @@ import java.awt.image.ImageConsumer;
import java.awt.image.ImageProducer;
import java.awt.image.Raster;
import java.awt.image.RenderedImage;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.io.InputStream;
......@@ -102,6 +103,11 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
0x00ff0000,
0x0000ff00,
0x000000ff);
public GdkPixbufDecoder (DataInput datainput)
{
super (datainput);
}
public GdkPixbufDecoder (InputStream in)
{
super (in);
......@@ -630,7 +636,14 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
boolean ignoreMetadata)
{
super.setInput(input, seekForwardOnly, ignoreMetadata);
dec = new GdkPixbufDecoder((InputStream) getInput());
Object get = getInput();
if (get instanceof InputStream)
dec = new GdkPixbufDecoder((InputStream) get);
else if (get instanceof DataInput)
dec = new GdkPixbufDecoder((DataInput) get);
else
throw new IllegalArgumentException("input object not supported: "
+ get);
}
public BufferedImage read(int imageIndex, ImageReadParam param)
......
/* ArrayPersistenceDelegate.java - A PersistenceDelegate that handles arrays.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder;
import java.beans.Encoder;
import java.beans.Expression;
import java.beans.PersistenceDelegate;
import java.beans.Statement;
import java.lang.reflect.Array;
import java.util.HashMap;
public class ArrayPersistenceDelegate extends PersistenceDelegate
{
private static final HashMap NULL_VALUES = new HashMap();
static
{
NULL_VALUES.put(Boolean.TYPE, Boolean.FALSE);
NULL_VALUES.put(Byte.TYPE, Byte.valueOf((byte) 0));
NULL_VALUES.put(Short.TYPE, Short.valueOf((short) 0));
NULL_VALUES.put(Integer.TYPE, Integer.valueOf(0));
NULL_VALUES.put(Long.TYPE, Long.valueOf(0));
NULL_VALUES.put(Float.TYPE, Float.valueOf(0.0f));
NULL_VALUES.put(Double.TYPE, Double.valueOf(0.0));
}
protected Expression instantiate(Object oldInstance, Encoder out)
{
Class type = oldInstance.getClass().getComponentType();
// oldInstance is expected to be an array, then
// getClass().getComponentType() should lead
// to its component type.
assert (type != null);
// Not handling primitive types in a special way here
// causes that Class.forName("int") is built as an Expression
// later which would cause an exception if executed. A special
// handling to avoid the execution for primitive types can be
// java.beans.Encoder.writeExpression() .
return new Expression(
oldInstance,
Array.class,
"newInstance",
new Object[] {
type,
new Integer(Array.getLength(oldInstance)) });
}
protected void initialize(Class type, Object oldInstance, Object newInstance,
Encoder out)
{
int length = Array.getLength(oldInstance);
// Compares the array value against a prototypical
// null value of the array's component type in order to skip
// writing the default values of an array.
// Note: I have no idea why the persistence delegate for arrays writes
// an Expression that reads the value and then writes a Statement that sets
// the value. However it turned out that object arrays work better with the
// get-Expression and primitive array work fine with the set-Statement.
type = type.getComponentType();
if (type.isPrimitive())
{
Object nullValue = NULL_VALUES.get(type);
for (int i = 0; i < length; i++)
{
Object oldValue = Array.get(oldInstance, i);
if (!oldValue.equals(nullValue))
{
out.writeExpression(new Expression(Array.class, "get",
new Object[] { oldInstance,
Integer.valueOf(i),
}));
out.writeStatement(new Statement(Array.class, "set",
new Object[] {
oldInstance,
Integer.valueOf(i),
oldValue
}));
}
}
}
else
{
for (int i = 0; i < length; i++)
{
Object oldValue = Array.get(oldInstance, i);
if (oldValue != null)
{
out.writeExpression(new Expression(Array.class, "get",
new Object[] { oldInstance,
Integer.valueOf(i),
}));
out.writeStatement(new Statement(Array.class, "set",
new Object[] {
oldInstance,
Integer.valueOf(i),
oldValue
}));
}
}
}
}
}
/* ClassPersistenceDelegate.java - A PersistenceDelegate for the Class type.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder;
import java.beans.Encoder;
import java.beans.Expression;
import java.beans.PersistenceDelegate;
/** <p>The <code>ClassPersistenceDelegate</code> creates
* <code>Expression</code> instances which denote class resolutions.</p>
*
* <p>The class resolution is always the last step when serializing a tree
* of objects. Due to the recursive nature of the algorithm we need a way
* to end the recursion. This is achieved by the implementation of this
* {@link instantiate} method. Arbitrary classes are described with a call
* to <code>Class.forName</code>. However for the <code>Class</code> class
* we call <code>getClass()</code> on a <code>String.class</code> instance.
* This in turn lead to the resolution of the String class which is always
* encoded as <code>"".getClass()</code>. Finally the <code>Encoder</code>
* treats strings in a special way so that the recursion ends here.
*
* @author Robert Schuster (robertschuster@fsfe.org)
*/
public class ClassPersistenceDelegate extends PersistenceDelegate
{
protected Expression instantiate(Object oldInstance, Encoder out)
{
Class oldClass = (Class) oldInstance;
// Due to the special handling of String instances in the Encoder
// this Expression does not lead to further class resolutions.
if (oldClass == String.class)
return new Expression(oldClass, "", "getClass", null);
// This Expression will lead to the class resolution of String.class.
if (oldClass == Class.class)
return new Expression(oldClass, String.class, "getClass", null);
// This Expression will lead to the class resolution of Class.class.
return new Expression(oldClass, Class.class, "forName",
new Object[] { oldClass.getName() });
}
}
/* CollectionPersistenceDelegate.java - A PersistenceDelegate for Collection subclasses.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder;
import java.util.Collection;
import java.beans.Encoder;
import java.beans.Expression;
import java.beans.PersistenceDelegate;
import java.beans.Statement;
import java.util.Iterator;
/** <p>A <code>PersistenceDelegate</code> implementation that calls
* the no-argument constructor to create the Collection instance and
* uses an iterator to add all the objects it reaches through it.</p>
*
* <p>It is used for <code>Set</code> and <code>List</code>
* implementations.</p>
*
* @author Robert Schuster (robertschuster@fsfe.org)
*/
public class CollectionPersistenceDelegate extends PersistenceDelegate
{
protected Expression instantiate(Object oldInstance, Encoder out)
{
return new Expression(
oldInstance,
oldInstance.getClass(),
"new",
null);
}
protected void initialize(Class type, Object oldInstance, Object newInstance,
Encoder out)
{
Iterator ite = ((Collection) oldInstance).iterator();
while (ite.hasNext())
{
out.writeStatement(new Statement(oldInstance, "add",
new Object[] { ite.next() }));
}
}
}
/* Context.java -- Provides calling context information to ScannerStates.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder;
/** A <code>Contect</code> object describes the current state
* and the call number while processing the original object
* tree in the {@link ScanEngine}.
*
* <p>The class allows to distinguish the different calling states
* and is neccessary for the child element skipping feature of
* the {@link GenericScannerState}.</p>
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
*/
public class Context
{
private String state;
private int call;
Context(String newState, int newCall)
{
state = newState;
call = newCall;
}
public int hashCode()
{
int hc = 7;
hc = 31 * hc + state.hashCode();
hc = 31 * hc + call;
return hc;
}
public boolean equals(Object o)
{
if (!(o instanceof Context))
return false;
Context that = (Context) o;
return state.equals(that.state)
&& call == that.call;
}
public String toString()
{
return "Context [state=" + state + ", call=" + call + "]";
}
}
/* GenericScannerState.java
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder;
import java.util.HashMap;
import gnu.java.beans.encoder.elements.ArrayInstantiation;
import gnu.java.beans.encoder.elements.Array_Get;
import gnu.java.beans.encoder.elements.Array_Set;
import gnu.java.beans.encoder.elements.ClassResolution;
import gnu.java.beans.encoder.elements.Element;
import gnu.java.beans.encoder.elements.List_Get;
import gnu.java.beans.encoder.elements.List_Set;
import gnu.java.beans.encoder.elements.MethodInvocation;
import gnu.java.beans.encoder.elements.NullObject;
import gnu.java.beans.encoder.elements.ObjectInstantiation;
import gnu.java.beans.encoder.elements.ObjectReference;
import gnu.java.beans.encoder.elements.PrimitiveInstantiation;
import gnu.java.beans.encoder.elements.StaticFieldAccess;
import gnu.java.beans.encoder.elements.StaticMethodInvocation;
import gnu.java.beans.encoder.elements.StringReference;
/**
* This class is a {@link ScannerState} implementation that creates
* suitable {@link gnu.java.beans.encoder.elements.Element} instances
* for each transition variant.
*
* <p>Furthermore it can optionally skip a certain number of child
* elements. The algorithm can cope with the fact that one
* <code>GenericScannerState</code> instance may be called at
* different levels of recursions.</p>
*
* @author Robert Schuster (robertschuster@fsfe.org)
*/
class GenericScannerState extends ScannerState
{
private int skipElements, initialSkipElements;
final Root root;
HashMap skipValues;
GenericScannerState(Root newRoot)
{
root = newRoot;
}
GenericScannerState(Root root, int skipElements)
{
this(root);
this.skipElements = initialSkipElements = skipElements;
if (skipElements > 0)
skipValues = new HashMap();
}
protected void enterImpl(Context ctx)
{
if (skipValues != null)
{
Integer skip = (Integer) skipValues.get(ctx);
if (skip == null)
{
skip = Integer.valueOf(initialSkipElements);
skipValues.put(ctx, skip);
}
skipElements = skip.intValue();
}
}
void methodInvocation(String methodName)
{
if (skipValues != null && skipElements > 0)
return;
root.addChild(new MethodInvocation(methodName));
}
void staticMethodInvocation(String className, String methodName)
{
if (skipValues != null && skipElements > 0)
return;
root.addChild(new StaticMethodInvocation(className, methodName));
}
void staticFieldAccess(String className, String fieldName)
{
if (skipValues != null && skipElements > 0)
return;
root.addChild(new StaticFieldAccess(className, fieldName));
}
void classResolution(String className)
{
if (skipValues != null && skipElements > 0)
return;
root.addChild(new ClassResolution(className));
}
void objectInstantiation(String className, ObjectId objectId)
{
if (skipValues != null && skipElements > 0)
return;
Element elem = new ObjectInstantiation(className);
elem.initId(objectId);
root.addChild(elem);
}
void primitiveInstantiation(String primitiveName, String valueAsString)
{
if (skipValues != null && skipElements > 0)
return;
root.addChild(new PrimitiveInstantiation(primitiveName, valueAsString));
}
void objectArrayInstantiation(String arrayClassName, String lengthAsString,
ObjectId objectId)
{
if (skipValues != null && skipElements > 0)
return;
Element elem = new ArrayInstantiation(arrayClassName, lengthAsString);
elem.initId(objectId);
root.addChild(elem);
}
void primitiveArrayInstantiation(String arrayClassName, String lengthAsString,
ObjectId objectId)
{
objectArrayInstantiation(arrayClassName, lengthAsString, objectId);
}
void arraySet(String indexAsString)
{
if (skipValues != null && skipElements > 0)
return;
root.addChild(new Array_Set(indexAsString));
}
void arrayGet(String indexAsString)
{
if (skipValues != null && skipElements > 0)
return;
root.addChild(new Array_Get(indexAsString));
}
void listGet()
{
if (skipValues != null && skipElements > 0)
return;
root.addChild(new List_Get());
}
void listSet()
{
if (skipValues != null && skipElements > 0)
return;
root.addChild(new List_Set());
}
void nullObject()
{
if (skipValues != null && skipElements > 0)
return;
root.addChild(new NullObject());
}
void stringReference(String string)
{
if (skipValues != null && skipElements > 0)
return;
root.addChild(new StringReference(string));
}
void objectReference(ObjectId id)
{
if (skipValues != null && skipElements > 0)
return;
root.addChild(new ObjectReference(id));
}
void end()
{
if (skipValues != null)
{
if (skipElements > 0)
skipElements--;
else
{
// Finishes the Element we are constructing.
root.end();
}
skipValues.put(context(), Integer.valueOf(skipElements));
}
else
root.end();
}
void enter()
{
}
}
/* IgnoringScannerState.java -- A ScannerState that does nothing.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder;
/** A special {@link ScannerState} implementation that ignores all child
* elements.
*
* <p>Consider the call hierarchy:
* <code>
* methodInvocation
* objectInstantiation
* classResolution*
* objectInstantiation
* classResolution
* </code>
* </p>
*
* <p>When the ignoring state is active one can filter the elements of
* one level. One has to set up the state machine that a transition
* via "class resolution" from a state that was reached via "object
* instantation" reaches an <code>IgnoringScannerState</code>.</p>
*
* <p>Setting the default successor of a <code>IgnoringScannerState</code>
* to itself causes all elements of the call hierarchy to be skipped
* until another state is reached by going back.</p>
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
*/
class IgnoringScannerState extends ScannerState
{
void methodInvocation(String methodName)
{
}
void staticMethodInvocation(String className, String methodName)
{
}
void staticFieldAccess(String className, String fieldName)
{
}
void classResolution(String className)
{
}
void objectInstantiation(String className, ObjectId objectId)
{
}
void primitiveInstantiation(String primitiveName, String valueAsString)
{
}
void objectArrayInstantiation(String arrayClassName, String lengthAsString, ObjectId objectId)
{
}
void primitiveArrayInstantiation(String arrayClassName, String lengthAsString, ObjectId objectId)
{
}
void arraySet(String indexAsString)
{
}
void arrayGet(String indexAsString)
{
}
void listGet()
{
}
void listSet()
{
}
void nullObject()
{
}
void stringReference(String string)
{
}
void objectReference(ObjectId id)
{
}
void end()
{
}
}
/* MapPersistenceDelegate.java -- A PersistenceDelegate for Map subclasses.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder;
import java.util.Map;
import java.beans.Encoder;
import java.beans.Expression;
import java.beans.PersistenceDelegate;
import java.beans.Statement;
import java.util.Iterator;
/**
* @author Robert Schuster (robertschuster@fsfe.org)
*/
public class MapPersistenceDelegate extends PersistenceDelegate
{
protected Expression instantiate(Object oldInstance, Encoder out)
{
return new Expression(
oldInstance,
oldInstance.getClass(),
"new",
null);
}
protected void initialize(Class type, Object oldInstance, Object newInstance,
Encoder out)
{
Map map = (Map) oldInstance;
Iterator ite = map.keySet().iterator();
while (ite.hasNext())
{
Object key = ite.next();
out.writeStatement(new Statement(oldInstance, "put",
new Object[] { key, map.get(key) }));
}
}
}
/* ObjectId.java -- Simple object identification mechanism for XML encoding.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder;
import java.util.HashMap;
/**
* <p>
* ObjectId provides an object identification mechanism which gives each object
* a name in the form <code>&lt;class&gt;&lt;Nameindex&gt;</code>.
* </p>
*
* <p>
* Each id can be in an unused state which means that only one instance of the
* object is in use and a special id is not needed. Certain {@link
* gnu.java.beans.encoder.elements.Element} subclasses use this feature to find
* out whether they write the "id" attribute or not.
* </p>
* <p>
* An <code>ObjectId</code> instance is typically given to multiple objects.
* The second user should then invoke the {@link #init} method to generate the
* identification string and bring the id in the 'used' state.
* </p>
*
* @author Robert Schuster (robertschuster@fsfe.org)
*/
public class ObjectId
{
/**
* Stores the index an object of a specific type should be given.
*/
private static HashMap nameIndices = new HashMap();
private String id;
private Class klass;
ObjectId(Class klass)
{
this.klass = klass;
}
public boolean isUnused()
{
return id == null;
}
public String toString()
{
return (id != null) ? id : "<unused id>";
}
/**
* <p>
* Generates a simple Id by concatenating a class name with a self-increasing
* number.
* </p>
*/
public void init()
{
assert (klass != null);
if (id != null)
return;
Integer count = (Integer) nameIndices.get(klass);
if (count == null)
{
count = Integer.valueOf(0);
}
if (klass.isArray())
{
Class ct = klass.getComponentType();
if (ct == Boolean.TYPE)
id = "booleanArray" + count.intValue();
else if (ct == Byte.TYPE)
id = "byteArray" + count.intValue();
else if (ct == Short.TYPE)
id = "shortArray" + count.intValue();
else if (ct == Integer.TYPE)
id = "intArray" + count.intValue();
else if (ct == Long.TYPE)
id = "longArray" + count.intValue();
else if (ct == Float.TYPE)
id = "floatArray" + count.intValue();
else if (ct == Double.TYPE)
id = "doubleArray" + count.intValue();
}
else
id = klass.getName() + count.intValue();
nameIndices.put(klass, Integer.valueOf(count.intValue() + 1));
}
}
/* PrimitivePersistenceDelegate.java
-- A PersistenceDelegate for primitive data types.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder;
import java.beans.Encoder;
import java.beans.Expression;
import java.beans.PersistenceDelegate;
/**
* A shared PersistenceDelegate implementation for all primitive types.
*
* @author Robert Schuster (robertschuster@fsfe.org)
*/
public class PrimitivePersistenceDelegate extends PersistenceDelegate
{
protected Expression instantiate(Object oldInstance, Encoder out)
{
// The implementation relies on the fact that every primitive
// wrapper class has a constructor accepting a String argument.
// By using these constructors creating a primitive instance
// depends on the String class only.
return new Expression(oldInstance, oldInstance.getClass(), "new",
new Object[] { oldInstance.toString() });
}
protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out)
{
// This is a hack to make serializing primitive arrays work correctly.
// Instead of modifying an existing primitive instance to make it equal
// with another instance (which is not possible because primitives are
// immutable) we create a new instance. This is against the specification
// of the initialize method but make things work fine.
out.writeExpression(new Expression(oldInstance, oldInstance.getClass(), "new",
new Object[] { oldInstance.toString() }));
}
}
/* ReportingScannerState.java -- A state for debugging purposes.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder;
/**
* A <code>ScannerState</code> implementation that prints useful details
* about its arguments. Use it when the XML encoding does not work correctly
* and you want to find out how things relate to each other.
*
* @author Robert Schuster (robertschuster@fsfe.org)
*/
class ReportingScannerState extends ScannerState
{
void methodInvocation(String methodName)
{
System.out.println("methodInvocation: " + methodName + "()");
}
void staticMethodInvocation(String className, String methodName)
{
System.out.println("staticMethodInvocation: " + className + "." + methodName + "()");
}
void staticFieldAccess(String className, String fieldName)
{
System.out.println("staticFieldAccess: " + className + "." + fieldName);
}
void classResolution(String className)
{
System.out.println("classResolution: " + className);
}
void objectInstantiation(String className, ObjectId objectId)
{
System.out.println("objectInstantiation: " + className);
}
void primitiveInstantiation(String primitiveName, String valueAsString)
{
System.out.println("primitiveInstantiation: (" + primitiveName + ") " + valueAsString);
}
void objectArrayInstantiation(String arrayClassName, String lengthAsString, ObjectId objectId)
{
System.out.println("objectArrayInstantiation: new " + arrayClassName + "[" + lengthAsString + "]");
}
void primitiveArrayInstantiation(String arrayClassName, String lengthAsString, ObjectId objectId)
{
System.out.println("primitiveArrayInstantiation: new " + arrayClassName + "[" + lengthAsString + "]");
}
void arraySet(String indexAsString)
{
System.out.println("arraySet: " + indexAsString);
}
void arrayGet(String indexAsString)
{
System.out.println("arrayGet: " + indexAsString);
}
void listGet()
{
System.out.println("listGet");
}
void listSet()
{
System.out.println("listSet");
}
void nullObject()
{
System.out.println("nullObject");
}
void stringReference(String string)
{
System.out.println("stringReference: " + string);
}
void objectReference(ObjectId id)
{
System.out.println("objectReference: " + id);
}
void end()
{
System.out.println("-close");
}
}
/* Root.java -- The root of an object tree.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder;
import java.beans.XMLEncoder;
import java.util.Iterator;
import java.util.Stack;
import gnu.java.beans.encoder.elements.Element;
/** <p><code>Root</code> provides a simple interface to a tree of
* objects.</p>
*
* <p>Using an instance of this class a logical representation of
* the real object tree that is serialized can be built. When the
* actual data should be written as XML <code>Root</code> and
* {@link gnu.java.beans.encoder.elements.Element} class can provide
* context information which is used to write the best fitting
* XML representation.</p>
*
* @author Robert Schuster (robertschuster@fsfe.org)
*/
public class Root
{
private Stack parents = new Stack();
private Element rootElement, current;
private boolean started;
public Root()
{
rootElement = current = new RootElement();
}
/** <p>Adds another child element to the tree.</p>
*
* <p>The new element automatically becomes the current
* element.</p>
*
* @param elem The new child element.
*/
public void addChild(Element elem)
{
current.addChild(elem);
parents.push(current);
current = elem;
}
/**
* <p>Marks that the end of the current element
* is reached and that no more childs are added to
* it.</p>
*
* <p>The behavior is to return to the nearest parent
* element.</p>
*/
public void end()
{
current = (Element) parents.pop();
}
/**
* <p>Goes back to the nearest parent element but
* deletes the just created child.</p>
*
* <p>This is used if something went wrong while
* processing the child element's {@link java.beans.Expression}
* or {@link java.beans.Statement}.</p>
*
*/
public void deleteLast()
{
current = (Element) parents.pop();
current.removeLast();
}
/**
* <p>Traverses the elements in the object tree
* and creates their XML representation in the output
* stream of the given {@link Writer}.</p>
*
* <p>Finally the <code>Writer</code> is flushed.</p>
*
* @param writer The Writer instance that generates the XML representation.
*/
public void traverse(Writer writer)
{
if (!started)
{
writer.writePreamble();
rootElement.writeStart(writer);
}
started = true;
traverse(writer, rootElement.iterator());
rootElement.clear();
writer.flush();
}
/** Writes the closing element and closes the {@link Writer}
*
* @param writer The Writer instance that generates the XML representation.
*/
public void close(Writer writer)
{
rootElement.writeEnd(writer);
writer.close();
}
/** Recursively traverses the object tree.
*
* @param writer The Writer instance that generates the XML representation.
* @param ite An Iterator returning Element instances.
*/
private void traverse(Writer writer, Iterator ite)
{
while (ite.hasNext())
{
Element e = (Element) ite.next();
e.writeStart(writer);
traverse(writer, e.iterator());
e.writeEnd(writer);
e.clear();
}
}
/** <p>A special Element implementation that represents the
* encoder's context.</p>
*
* <p>This element is written only once per Writer.</p>
*
* <p>It is assumed that this element is never empty to simplify
* the implementation.</p>
*
* @author Robert Schuster (robertschuster@fsfe.org);
*
*/
static class RootElement extends Element
{
public void writeStart(Writer writer)
{
writer.write("java", new String[] { "version", "class" },
new String[] { System.getProperty("java.version"),
XMLEncoder.class.getName() }, false);
}
public void writeEnd(Writer writer)
{
writer.writeEnd(false);
}
}
}
/* ScannerState.java
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder;
import java.util.HashMap;
/** <p>Provides the infrastructure for the state machine and the transition
* mechanism.</p>
*
* <p>Each states knows a set of successor. There can be one successor for
* every transition variant. Furthermore a state knows about a default
* successor which is taken when there is no special setup for a
* transition.</p>
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
*/
public abstract class ScannerState
{
static final int TRANSITION_METHOD_INVOCATION = 0;
static final int TRANSITION_STATIC_METHOD_INVOCATION = 1;
static final int TRANSITION_STATIC_FIELD_ACCESS = 2;
static final int TRANSITION_CLASS_RESOLUTION = 3;
static final int TRANSITION_OBJECT_INSTANTIATION = 4;
static final int TRANSITION_PRIMITIVE_INSTANTIATION = 5;
static final int TRANSITION_OBJECT_ARRAY_INSTANTIATION = 6;
static final int TRANSITION_PRIMITIVE_ARRAY_INSTANTIATION = 7;
static final int TRANSITION_ARRAY_SET = 8;
static final int TRANSITION_ARRAY_GET = 9;
static final int TRANSITION_LIST_SET = 10;
static final int TRANSITION_LIST_GET = 11;
static final int TRANSITION_NULL_OBJECT = 12;
static final int TRANSITION_STRING_REFERENCE = 13;
static final int TRANSITION_OBJECT_REFERENCE = 14;
static final int TRANSITION_FIRST = 0;
static final int TRANSITION_LAST = 14;
static final String DEFAULT_STATE_NAME = "default";
String defaultSuccessor = DEFAULT_STATE_NAME;
static String[] transitionNames = { "METHOD_INVOCATION", "STATIC_METHOD_INVOCATION",
"STATIC_FIELD_ACCESS", "CLASS_RESOLUTION",
"OBJECT_INSTANTIATION",
"PRIMITIVE_INSTANTIATION", "OBJECT_ARRAY_INSTANTIATION",
"PRIMITIVE_ARRAY_INSTANTIATION",
"ARRAY_SET", "ARRAY_GET", "LIST_SET", "LIST_GET",
"NULL_OBJECT", "STRING_REFERENCE", "OBJECT_REFERENCE" };
/**
* Stores the transition setup as the relation
* transition->successor's state name.
*/
HashMap transitions = new HashMap();
int calls;
Context context;
String name;
final void init(String newName)
{
assert (name == null);
name = newName;
}
final String getName()
{
return name;
}
final void enter(Context ctx)
{
calls++;
context = ctx;
enterImpl(ctx);
}
protected void enterImpl(Context ctx)
{
}
final Context context()
{
return context;
}
final int getCalls()
{
return calls;
}
/**
* <p>Stores a successor's state name for a certain transition.</p>
*
* <p>This method is only used at the configuration time of the state
* machine.</p>
*
* @param transition One of the transition constants.
* @param stateName The state name of the successor.
*/
final void putSuccessor(int transition, String stateName)
{
assert (transition >= TRANSITION_FIRST && transition <= TRANSITION_LAST) :
"Transition identifier '" + transition + "' is unknown.";
transitions.put(new Integer(transition), stateName);
}
/** <p>Retrieves a the state name of a successor for the given transition
* constant.</p>
*
* <p>Returns the default successor's state name if no special setup was
* prepared.</p>
*
* @param transition One of the transition constants.
* @return The state name of the successor.
*/
final String getSuccessor(int transition)
{
String state = (String) transitions.get(new Integer(transition));
return (state == null) ? defaultSuccessor : state;
}
/**
* Sets the name for the default successor state.
*
* @param newDefaultSuccessor The default successor's state name.
*/
final void setDefaultSuccessor(String newDefaultSuccessor)
{
defaultSuccessor = newDefaultSuccessor;
}
abstract void methodInvocation(String methodName);
abstract void staticMethodInvocation(String className, String methodName);
abstract void staticFieldAccess(String className, String fieldName);
abstract void classResolution(String className);
abstract void objectInstantiation(String className, ObjectId objectId);
abstract void primitiveInstantiation(String primitiveName,
String valueAsString);
abstract void objectArrayInstantiation(String arrayClassName, String lengthAsString, ObjectId objectId);
abstract void primitiveArrayInstantiation(String arrayClassName, String lengthAsString, ObjectId objectId);
abstract void arraySet(String indexAsString);
abstract void arrayGet(String indexAsString);
abstract void listGet();
abstract void listSet();
abstract void nullObject();
abstract void stringReference(String string);
abstract void objectReference(ObjectId id);
/**
* <p>A special event that does not provoke a direct transition.</p>
*
* <p>Instead the transition is done by the <code>ScanEngine</code>: It goes
* back to the previous state and just uses this method to inform the state
* about this happening.</p>
*/
abstract void end();
void enter()
{
}
}
/* StAXWriter.java
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder;
import java.io.OutputStream;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
/** A {@link Writer} implementation based on the StAX API.
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
*/
public class StAXWriter implements Writer
{
XMLStreamWriter writer;
int indent = 0;
public StAXWriter(OutputStream os)
{
try
{
XMLOutputFactory factory = XMLOutputFactory.newInstance();
writer = factory.createXMLStreamWriter(os);
}
catch (XMLStreamException se)
{
throw (InternalError)
new InternalError(
"Could not instantiate a streaming XML writer.")
.initCause(se);
}
}
public void flush()
{
if (writer != null)
{
try
{
writer.flush();
}
catch (XMLStreamException xse)
{
// TODO: find out
}
}
}
public void close()
{
if (writer != null)
{
try
{
writer.close();
}
catch (XMLStreamException xse)
{
// TODO: find out
}
writer = null;
}
}
public void writePreamble()
{
try
{
writer.writeStartDocument("UTF-8", "1.0");
}
catch (XMLStreamException xmlse)
{
}
}
public void writeEnd(boolean wasEmpty)
{
try
{
indent -= 2;
if (wasEmpty)
return;
for (int i = 0; i < indent; i++)
writer.writeCharacters(" ");
writer.writeEndElement();
writer.writeCharacters("\n");
}
catch (XMLStreamException xmlse)
{
}
}
public void writeEndNoChildren()
{
try
{
writer.writeEndElement();
writer.writeCharacters("\n");
}
catch (XMLStreamException xmlse)
{
}
}
public void write(String tagName, boolean empty)
{
write(tagName, null, null, null, empty);
}
public void write(String tagName, String value)
{
write(tagName, value, null, null, value == null);
}
public void writeNoChildren(String tagName, String value)
{
try
{
for (int i = 0; i < indent; i++)
writer.writeCharacters(" ");
writer.writeStartElement(tagName);
writer.writeCharacters(value);
}
catch (XMLStreamException xmlse)
{
}
}
public void write(String tagName, String attributeName,
String attributeValue, boolean empty)
{
write(tagName, null, new String[] { attributeName },
new String[] { attributeValue }, empty);
}
public void write(String tagName, String value, String[] attributeNames,
String[] attributeValues, boolean empty)
{
try
{
for (int i = 0; i < indent; i++)
writer.writeCharacters(" ");
if (empty)
writer.writeEmptyElement(tagName);
else
writer.writeStartElement(tagName);
if (attributeNames != null)
for (int i = 0; i < attributeNames.length; i++)
writer.writeAttribute(attributeNames[i], attributeValues[i]);
writer.writeCharacters("\n");
indent += 2;
if (value != null)
{
for (int i = 0; i < indent; i++)
writer.writeCharacters(" ");
writer.writeCharacters(value);
writer.writeCharacters("\n");
}
}
catch (XMLStreamException xmlse)
{
}
}
public void write(String tagName, String[] attributeNames,
String[] attributeValues, boolean empty)
{
write(tagName, null, attributeNames, attributeValues, empty);
}
}
/* Writer.java -- Writing interface for XML persistence.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder;
/** A <code>Writer</code> represents a simplified interface to an XML
* writer that is used for the XML persistence mechanism.
*
* <p>Its sole purpose is to allow multiple backends which may remove
* the need to have certain APIs in the classpath. Eg. it is possible
* to write a stripped down XML Writer that does not rely on SAX, StAX
* or DOM APIs.</p>
*
* <p>The caller may assume that every action is done immediately. However
* it is possible that the underlying implementation uses buffering streams.
* To make sure the data is written call the {@link flush} method.</p>
*
* <p>The <code>Writer</code> implementation should care about the formatting
* of the XML stream making it possible to generate three types of formats using
* a special method invocation chain.</p>
*
* <p>Write
* <code>
* &lt;element/&gt;
* </code>
* by issuing <code>write("element", true)</code> (or any of the other
* write-variants that allows specifying the <code>isEmpty</code> argument)
* and <code>writeEnd(true)</code>.</p>
*
* <p>Write
* <code>
* &lt;element&gt;body&lt;/element&gt;
* </code>
* by issuing <code>writeNoChildren("element", "body")</code> and <code>writeNoChildrenEnd()</code>.</p>
*
* <p>
* Write
* <code>
* &lt;element&gt;
* &lt;child1/&gt;
* &lt;child2/&gt;
* ...
* &lt;element/&gt;
* </code>
* by issuing <code>write("element", false)</code> (or any of the other
* write-variants that allows specifying the <code>isEmpty</code> argument)
* and <code>writeEnd(false)</code>.</p>
*
* <p>Note: It is important that the values of <code>isEmpty</code> and
* <code>wasEmpty</code> match. Otherwise strange things might happen to
* the layout.</p>
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
*/
public interface Writer
{
// TODO: This interface's design is not the best. Feel free to
// improve it as you like.
/** Writes the XML preamble. */
void writePreamble();
/** Writes the end of an XML tag.
*
* <p>If your tag has not generated any body text or child
* elements provide <code>true</code> as the argument to generate
* more space efficient variant of the tag.>/p>
*
* @param wasEmpty Whether the tag was empty or not.
*/
void writeEnd(boolean wasEmpty);
/** Writes an XML tag without any attributes.
*
* @param tagName The name of the tag to write.
* @param empty Whether the element has child elements.
*/
void write(String tagName, boolean empty);
/** Writes an XML tag with one attribute name and value.
*
* @param tagName The name of the tag to write.
* @param attributeName The name of attribute.
* @param attributeValue The attribute's value.
* @param empty Whether the element has child elements.
*/
void write(String tagName, String attributeName, String attributeValue, boolean empty);
/** Writes an XML tag with multiple attributes and a body text.
*
* @param tagName The name of the tag to write.
* @param value The element's body content.
* @param attributeNames A set of attribute names.
* @param attributeValues A set of attribute values.
* @param empty Whether the element has child elements.
*/
void write(String tagName, String value, String[] attributeNames,
String[] attributeValues, boolean empty);
/** Writes an XML tag with multiple attributes without a body text.
*
* @param tagName The name of the tag to write.
* @param attributeNames A set of attribute names.
* @param attributeValues A set of attribute values.
* @param empty Whether the element has child elements.
*/
void write(String tagName, String[] attributeNames, String[] attributeValues, boolean empty);
/** Writes an XML tag with no attributes but with a body text
* that may have child elements.
*
* @param tagName The name of the tag to write.
* @param value The element's body content.
*/
void write(String tagName, String value);
/** Writes an XML tag with no attributes but with a body text
* that does not have child elements.
*
* @param tagName The name of the tag to write.
* @param value The element's body content.
*/
void writeNoChildren(String tagName, String value);
/** Writes the end of an XML tag that has no child elements.
*
* <p>Must be used in combination with {@link writeNoChildren} only.</p>
*/
void writeEndNoChildren();
/** Forces the implementation to write some data.
*/
void flush();
/** Closes the writer.
*/
void close();
}
/* ArrayInstantiation.java
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder.elements;
import gnu.java.beans.encoder.ObjectId;
import gnu.java.beans.encoder.Writer;
/** Generates an XML element denoting the instantiation of an array.
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
*/
public class ArrayInstantiation extends Element
{
final String className;
final String lengthAsString;
public ArrayInstantiation(String newClassName, String newLengthAsString)
{
className = newClassName;
lengthAsString = newLengthAsString;
}
public void writeStart(Writer writer)
{
ObjectId objectId = getId();
if (objectId.isUnused())
writer.write("array", new String[] { "class", "length" },
new String[] { className, lengthAsString }, isEmpty());
else
writer.write("array", new String[] { "id", "class", "length" },
new String[] { objectId.toString(), className,
lengthAsString }, isEmpty());
}
}
/* Array_Get.java
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder.elements;
import gnu.java.beans.encoder.Writer;
/**
* Generates an XML element denoting the retrieval of an array value.
*
* @author Robert Schuster (robertschuster@fsfe.org)
*/
public class Array_Get extends Element
{
final String indexAsString;
public Array_Get(String newIndexAsString)
{
indexAsString = newIndexAsString;
}
public void writeStart(Writer writer)
{
writer.write("void", "index", indexAsString, isEmpty());
}
}
/* Array_Set.java -- FIXME: briefly describe file purpose
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder.elements;
import gnu.java.beans.encoder.Writer;
public class Array_Set extends Element
{
final String indexAsString;
public Array_Set(String newIndexAsString)
{
indexAsString = newIndexAsString;
}
public void writeStart(Writer writer)
{
writer.write("void", "index", indexAsString, isEmpty());
}
}
/* ClassResolution.java
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder.elements;
import gnu.java.beans.encoder.Writer;
/** Generates an XML element denoting the resolution of a class.
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
*/
public class ClassResolution extends Element
{
final String className;
public ClassResolution(String newClassName)
{
className = newClassName;
}
public void writeStart(Writer writer)
{
writer.writeNoChildren("class", className);
}
public void writeEnd(Writer writer)
{
writer.writeEndNoChildren();
}
}
/* Element.java -- Base class for object tree elements.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder.elements;
import java.util.Iterator;
import java.util.LinkedList;
import gnu.java.beans.encoder.ObjectId;
import gnu.java.beans.encoder.Writer;
/** <code>Element</code> is the base class for the object tree elements.
*
* <p>It provides the neccessary infrastructure every element subclass
* needs in order to interact with the {@link gnu.java.beans.encoder.Root}
* class.</p>
*
* @author Robert Schuster (robertschuster@fsfe.org)
*/
public abstract class Element
{
/**
* Stores the child elements.
*/
private LinkedList children = new LinkedList();
/**
* An optional ObjectId instance which is needed for certain subclasses
* only.
*/
private ObjectId objectId;
/** Sets an {@link gnu.java.beans.encoder.ObjectId} instance in this
* <code>Element</code>.
*
* <p>This can only be done once.</p>
*
* @param objectId An ObjectId instance.
*/
public final void initId(ObjectId objectId)
{
assert (this.objectId == null);
assert (objectId != null);
this.objectId = objectId;
}
/** Adds a child element to this <code>Element</code>.
*
* @param elem The new child.
*/
public final void addChild(Element elem)
{
children.add(elem);
}
/** Removes the child element added last.
*/
public final void removeLast()
{
children.removeLast();
}
/** Provides access to the child elements via an iterator.
*
* @return An iterator for the child elements.
*/
public final Iterator iterator(){
return children.iterator();
}
/** Clears all the stored child elements.
*
*/
public final void clear()
{
children.clear();
}
/** Returns whether this element contains child elements.
*
* <p>This method is useful to decide which formatting variant
* for the XML element can be chosen.</p>
*
* @return Whether the element has child elements.
*/
public final boolean isEmpty()
{
return children.isEmpty();
}
/** Retrieves the element's {@link gnu.java.beans.encoder.ObjectId} instance
* if it has one.
*
* @return The ObjectId instance or <code>null</code>.
*/
public final ObjectId getId()
{
return objectId;
}
/** Writes the opening XML tag.
*
* @param writer The writer to be used for XML writing.
*/
public abstract void writeStart(Writer writer);
/** Writes the closing XML tag.
*
* <p>By default this does <code>writer.writeEnd(children.isEmpty())</code>.
* Override if neccessary, for example when using the
* {@link gnu.java.beans.encoder.Writer#writeNoChildren}</code> method
* variants.
*
* @param writer The writer to be used for XML writing.
*/
public void writeEnd(Writer writer)
{
writer.writeEnd(children.isEmpty());
}
}
/* ContentHandler2.java --
Copyright (C) 2004 Free Software Foundation, Inc.
/* List_Get.java
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
......@@ -35,31 +35,22 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.xml.aelfred2;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
package gnu.java.beans.encoder.elements;
/**
* Extension to the SAX ContentHandler interface to report parsing events
* and parameters required by DOM Level 3 but not supported by SAX.
import gnu.java.beans.encoder.Writer;
/** Generates an XML element denoting the retrieval of a list's element.
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
* @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
*/
public interface ContentHandler2
extends ContentHandler
public class List_Get extends Element
{
/**
* Reports the XML declaration.
* @param version the value of the version attribute in the XML
* declaration
* @param encoding the encoding specified in the XML declaration, if any
* @param standalone the standalone attribute from the XML declaration
* @param inputEncoding the encoding of the XML input
*/
void xmlDecl(String version, String encoding, boolean standalone,
String inputEncoding)
throws SAXException;
public void writeStart(Writer writer)
{
writer.write("object", "get");
}
}
/* javaio.h - Declaration for common java.io native functions
Copyright (C) 1998, 2004 Free Software Foundation, Inc.
/* List_Set.java
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
......@@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
......@@ -36,23 +36,21 @@ obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
#ifndef JAVAIO_H_INCLUDED
#define JAVAIO_H_INCLUDED
package gnu.java.beans.encoder.elements;
#include <stddef.h>
import gnu.java.beans.encoder.Writer;
/*
* Function Prototypes
/** Generates an XML element denoting the setting of a list's element.
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
*/
extern jlong _javaio_get_file_length(JNIEnv *, jint);
extern jlong _javaio_skip_bytes(JNIEnv *, jint, jlong);
extern jint _javaio_open(JNIEnv *, jstring, int);
extern jint _javaio_open_read(JNIEnv *, jstring);
extern jint _javaio_open_readwrite(JNIEnv *, jstring);
extern void _javaio_close(JNIEnv *, jint fd);
extern jint _javaio_read(JNIEnv *, jint, jarray, jint, jint);
extern jint _javaio_write(JNIEnv *, jint, jarray, jint, jint);
#endif /* JAVAIO_H_INCLUDED */
public class List_Set extends Element
{
public void writeStart(Writer writer)
{
writer.write("object", "set");
}
}
/* MethodCall.java
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder.elements;
import gnu.java.beans.encoder.Writer;
/** Generates an XML element denoting a non-static method call.
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
*/
public class MethodInvocation extends Element
{
final String methodName;
public MethodInvocation(String newMethodName)
{
methodName = newMethodName;
}
public void writeStart(Writer writer)
{
writer.write("void", "method", methodName, isEmpty());
}
}
/* NullObject.java
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder.elements;
import gnu.java.beans.encoder.Writer;
/** Generates an XML element denoting the <code>null</code> value.
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
*/
public class NullObject extends Element
{
public void writeStart(Writer writer)
{
writer.write("null", true);
}
public void writeEnd(Writer writer)
{
writer.writeEnd(true);
}
}
/* ObjectInstantiation.java
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder.elements;
import gnu.java.beans.encoder.ObjectId;
import gnu.java.beans.encoder.Writer;
/** Generates an XML element denoting the instantiation of an object.
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
*/
public class ObjectInstantiation extends Element
{
final String className;
public ObjectInstantiation(String newClassName)
{
className = newClassName;
}
public void writeStart(Writer writer)
{
ObjectId objectId = getId();
if (objectId.isUnused())
writer.write("object", "class", className, isEmpty());
else
writer.write("object", new String[] { "id", "class" },
new String[] { objectId.toString(), className }, isEmpty());
}
}
/* StringInstantiation.java
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder.elements;
import gnu.java.beans.encoder.ObjectId;
import gnu.java.beans.encoder.Writer;
/** Generates an XML element denoting referencing an existing object.
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
*/
public class ObjectReference extends Element
{
final ObjectId id;
public ObjectReference(ObjectId newId)
{
id = newId;
// Initializing the Id here is making sure it gets
// actually used. This step modifies the Id instance
// in other elements.
id.init();
}
public void writeStart(Writer writer)
{
writer.write("object", "idref", id.toString(), isEmpty());
}
}
/* PrimitiveInstantiation.java
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder.elements;
import gnu.java.beans.encoder.Writer;
/** Generates an XML element denoting a primitive data value.
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
*/
public class PrimitiveInstantiation extends Element
{
final String primitiveName;
final String valueAsString;
public PrimitiveInstantiation(String newPrimitiveName, String newValueAsString)
{
primitiveName = newPrimitiveName;
valueAsString = newValueAsString;
}
public void writeStart(Writer writer)
{
writer.writeNoChildren(primitiveName, valueAsString);
}
public void writeEnd(Writer writer)
{
writer.writeEndNoChildren();
}
}
/* StaticFieldAccess.java
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder.elements;
import gnu.java.beans.encoder.Writer;
/** Generates an XML element denoting a static method call.
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
*/
public class StaticFieldAccess extends Element
{
final String className;
final String fieldName;
public StaticFieldAccess(String newClassName, String newFieldName)
{
className = newClassName;
fieldName = newFieldName;
}
public void writeStart(Writer writer)
{
writer.write("object", new String[] { "class", "field" },
new String[] { className, fieldName }, isEmpty());
}
}
/* StaticMethodCall.java
-- A class denoting an XML element which makes up a static method call.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder.elements;
import gnu.java.beans.encoder.Writer;
/**
*
* @author Robert Schuster (robertschuster@fsfe.org)
*
*/
public class StaticMethodInvocation extends Element
{
final String className;
final String methodName;
public StaticMethodInvocation(String newClassName, String newMethodName)
{
className = newClassName;
methodName = newMethodName;
}
public void writeStart(Writer writer)
{
writer.write("void", new String[] { "class", "method" },
new String[] { className, methodName }, isEmpty());
}
}
/* StringInstantiation.java
-- A class denoting an XML element which retrieves an array element.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.beans.encoder.elements;
import gnu.java.beans.encoder.Writer;
public class StringReference extends Element
{
final String string;
public StringReference(String newString)
{
string = newString;
}
public void writeStart(Writer writer)
{
writer.writeNoChildren("string", string);
}
public void writeEnd(Writer writer)
{
writer.writeEndNoChildren();
}
}
......@@ -128,7 +128,7 @@ public class CRLFInputStream
in.reset();
if (i != -1)
{
l = in.read(b, off, i + 1); // read to CR
l = in.read(b, off, (i + 1) - off); // read to CR
in.read(); // skip LF
b[i] = LF; // fix CR as LF
}
......
......@@ -38,8 +38,6 @@ exception statement from your version. */
package gnu.java.net;
import gnu.classpath.Configuration;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocketImpl;
......@@ -64,20 +62,7 @@ import java.net.SocketException;
*/
public final class PlainDatagramSocketImpl extends DatagramSocketImpl
{
// Static initializer to load native library
static
{
if (Configuration.INIT_LOAD_LIBRARY)
{
System.loadLibrary("javanet");
}
}
/**
* Option id for the IP_TTL (time to live) value.
*/
private static final int IP_TTL = 0x1E61; // 7777
/**
* This is the actual underlying file descriptor
*/
......@@ -98,6 +83,7 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*/
public PlainDatagramSocketImpl()
{
// Nothing to do here.
}
protected void finalize() throws Throwable
......@@ -123,15 +109,48 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*
* @exception SocketException If an error occurs
*/
protected synchronized native void bind(int port, InetAddress addr)
throws SocketException;
protected synchronized void bind(int port, InetAddress addr)
throws SocketException
{
VMPlainDatagramSocketImpl.bind(this, port, addr);
}
/**
* Creates a new datagram socket
*
* @exception SocketException If an error occurs
*/
protected synchronized native void create() throws SocketException;
protected synchronized void create() throws SocketException
{
VMPlainDatagramSocketImpl.create(this);
}
/**
* Connects to the remote address and port specified as arguments.
*
* @param addr The remote address to connect to
* @param port The remote port to connect to
*
* @exception SocketException If an error occurs
*/
protected void connect(InetAddress addr, int port) throws SocketException
{
VMPlainDatagramSocketImpl.connect(this, addr, port);
}
/**
* Disconnects the socket.
*
* @since 1.4
*/
protected void disconnect()
{
synchronized (this)
{
if (native_fd != -1)
close();
}
}
/**
* Sets the Time to Live value for the socket
......@@ -142,7 +161,7 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*/
protected synchronized void setTimeToLive(int ttl) throws IOException
{
setOption(IP_TTL, new Integer(ttl));
setOption(VMPlainDatagramSocketImpl.IP_TTL, new Integer(ttl));
}
/**
......@@ -154,7 +173,7 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*/
protected synchronized int getTimeToLive() throws IOException
{
Object obj = getOption(IP_TTL);
Object obj = getOption(VMPlainDatagramSocketImpl.IP_TTL);
if (! (obj instanceof Integer))
throw new IOException("Internal Error");
......@@ -162,20 +181,6 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
return ((Integer) obj).intValue();
}
/**
* Sends a packet of data to a remote host
*
* @param addr The address to send to
* @param port The port to send to
* @param buf The buffer to send
* @param offset The offset of the data in the buffer to send
* @param len The length of the data to send
*
* @exception IOException If an error occurs
*/
private native void sendto (InetAddress addr, int port,
byte[] buf, int offset, int len)
throws IOException;
/**
* Sends a packet of data to a remote host
......@@ -186,12 +191,13 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*/
protected void send(DatagramPacket packet) throws IOException
{
synchronized(SEND_LOCK)
if (native_fd != -1)
{
sendto(packet.getAddress(), packet.getPort(), packet.getData(),
packet.getOffset(), packet.getLength());
}
synchronized(SEND_LOCK)
{
VMPlainDatagramSocketImpl.send(this, packet);
}
}
}
/**
......@@ -206,18 +212,10 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
{
synchronized(RECEIVE_LOCK)
{
receive0(packet);
VMPlainDatagramSocketImpl.receive(this, packet);
}
}
/**
* Native call to receive a UDP packet from the network
*
* @param packet The packet to fill in with the data received
*
* @exception IOException IOException If an error occurs
*/
private native void receive0(DatagramPacket packet) throws IOException;
/**
* Sets the value of an option on the socket
......@@ -227,8 +225,11 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*
* @exception SocketException If an error occurs
*/
public synchronized native void setOption(int option_id, Object val)
throws SocketException;
public synchronized void setOption(int option_id, Object val)
throws SocketException
{
VMPlainDatagramSocketImpl.setOption(this, option_id, val);
}
/**
* Retrieves the value of an option on the socket
......@@ -239,13 +240,19 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*
* @exception SocketException If an error occurs
*/
public synchronized native Object getOption(int option_id)
throws SocketException;
public synchronized Object getOption(int option_id)
throws SocketException
{
return VMPlainDatagramSocketImpl.getOption(this, option_id);
}
/**
* Closes the socket
*/
protected synchronized native void close();
protected synchronized void close()
{
VMPlainDatagramSocketImpl.close(this);
}
/**
* Gets the Time to Live value for the socket
......@@ -282,7 +289,10 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*
* @exception IOException If an error occurs
*/
protected synchronized native void join(InetAddress addr) throws IOException;
protected synchronized void join(InetAddress addr) throws IOException
{
VMPlainDatagramSocketImpl.join(this,addr);
}
/**
* Leaves a multicast group
......@@ -291,7 +301,10 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*
* @exception IOException If an error occurs
*/
protected synchronized native void leave(InetAddress addr) throws IOException;
protected synchronized void leave(InetAddress addr) throws IOException
{
VMPlainDatagramSocketImpl.leave(this, addr);
}
/**
* What does this method really do?
......@@ -308,14 +321,14 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
}
public void joinGroup(SocketAddress address, NetworkInterface netIf)
throws IOException
{
throw new InternalError
("PlainDatagramSocketImpl::joinGroup is not implemented");
VMPlainDatagramSocketImpl.joinGroup(this, address, netIf);
}
public void leaveGroup(SocketAddress address, NetworkInterface netIf)
throws IOException
{
throw new InternalError
("PlainDatagramSocketImpl::leaveGroup is not implemented");
VMPlainDatagramSocketImpl.leaveGroup(this, address, netIf);
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment