[kaffe] CVS kaffe (robilad): resynced with gnu classpath: corba fixes

Kaffe CVS cvs-commits at kaffe.org
Sun May 29 19:25:43 PDT 2005


PatchSet 6595 
Date: 2005/05/30 02:21:00
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
resynced with gnu classpath: corba fixes

Members: 
	ChangeLog:1.4120->1.4121 
	libraries/javalib/Makefile.am:1.357->1.358 
	libraries/javalib/Makefile.in:1.447->1.448 
	libraries/javalib/all.files:1.130->1.131 
	libraries/javalib/gnu/CORBA/Functional_ORB.java:1.2->1.3 
	libraries/javalib/gnu/CORBA/ServiceRequestAdapter.java:INITIAL->1.1 
	libraries/javalib/gnu/CORBA/gnuNVList.java:1.1->1.2 
	libraries/javalib/gnu/CORBA/gnuRequest.java:1.2->1.3 
	libraries/javalib/gnu/CORBA/streamReadyHolder.java:INITIAL->1.1 
	libraries/javalib/org/omg/CORBA/DynValue.java:INITIAL->1.1 
	libraries/javalib/org/omg/CORBA/ORB.java:1.4->1.5 
	libraries/javalib/org/omg/CORBA/ServerRequest.java:1.1->1.2 
	libraries/javalib/org/omg/CORBA/UnknownUserException.java:INITIAL->1.1 
	libraries/javalib/org/omg/CORBA/package.html:1.1->1.2 
	libraries/javalib/org/omg/CosNaming/_BindingIteratorImplBase.java:1.1->1.2 
	libraries/javalib/org/omg/CosNaming/_NamingContextExtImplBase.java:1.1->1.2 
	libraries/javalib/org/omg/CosNaming/_NamingContextImplBase.java:1.1->1.2 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4120 kaffe/ChangeLog:1.4121
--- kaffe/ChangeLog:1.4120	Mon May 30 01:27:44 2005
+++ kaffe/ChangeLog	Mon May 30 02:21:00 2005
@@ -1,6 +1,54 @@
 2005-05-30  Dalibor Topic  <robilad at kaffe.org>
 
         Resynced with GNU Classpath.
+
+	2005-05-29  Audrius Meskauskas  <AudriusA at Bioinformatics.org>
+
+	* org/omg/CosNaming/_BindingIteratorImplBase.java ,
+	org/omg/CosNaming/_NamingContextExtImplBase.java,
+	org/omg/CosNaming/_NamingContextImplBase.java: Inherit from
+	DynamicImplementation.
+	* gnu/CORBA/ServiceRequestAdapter.java: New class.
+	* gnu/CORBA/gnuNVList.java (add, add_item):
+	Replacing null by constructed instance.
+
+	2005-05-29  Audrius Meskauskas  <AudriusA at Bioinformatics.org>
+
+	* org/omg/CORBA/Functional_ORB.java (serve, useProperties, init): Implementing
+	the property-configurable time-outs. 
+
+	2005-05-29  Audrius Meskauskas  <AudriusA at Bioinformatics.org>
+
+	* gnu/CORBA/gnuRequest.java (p_invoke): Wrap the received UserException into
+	UnknownUserException.
+	* gnu/CORBA/streamReadyHolder.java: New wrapper for UserException. 
+	* org/omg/CORBA/UnknownUserException.java: New exception.
+	
+	2005-05-27  Audrius Meskauskas  <AudriusA at Bioinformatics.org>
+
+	* omg/org/CORBA/ORB.java (create_recursive_sequence_tc): New method.
+
+	2005-05-27  Audrius Meskauskas  <AudriusA at Bioinformatics.org>
+
+	* omg/org/CORBA/DynValue.java: New interface.
+
+	2005-05-27  Audrius Meskauskas  <AudriusA at Bioinformatics.org>
+
+	* omg/org/CORBA/package.html: Documentation update.
+
+	2005-05-26  Audrius Meskauskas  <AudriusA at Bioinformatics.org>
+
+	* org/omg/CORBA/ORB.java (create_basic_dyn_any): 
+	Declare it may throw an InconsistentTypeCode.
+	(create_dyn_any): Remove wrong exception declaration.
+	(create_operation_list, create_abstract_interface_tc, 
+	create_native_tc, get_service_information): Implementing these methods.
+	* org/omg/CORBA/ServerRequest.java (result, except, params, op_name): 
+	Marking deprecated.
+	
+2005-05-30  Dalibor Topic  <robilad at kaffe.org>
+
+        Resynced with GNU Classpath.
 	
 	2005-05-27  Roman Kennke  <roman at kennke.org>
 
Index: kaffe/libraries/javalib/Makefile.am
diff -u kaffe/libraries/javalib/Makefile.am:1.357 kaffe/libraries/javalib/Makefile.am:1.358
--- kaffe/libraries/javalib/Makefile.am:1.357	Thu May 26 10:24:26 2005
+++ kaffe/libraries/javalib/Makefile.am	Mon May 30 02:21:03 2005
@@ -378,6 +378,7 @@
 	gnu/CORBA/OctetHolder.java \
 	gnu/CORBA/Restricted_ORB.java \
 	gnu/CORBA/ServiceDetailHolder.java \
+	gnu/CORBA/ServiceRequestAdapter.java \
 	gnu/CORBA/Simple_delegate.java \
 	gnu/CORBA/TypeCodeHelper.java \
 	gnu/CORBA/Unexpected.java \
@@ -403,6 +404,7 @@
 	gnu/CORBA/primitiveTypeCode.java \
 	gnu/CORBA/recordTypeCode.java \
 	gnu/CORBA/recursiveTypeCode.java \
+	gnu/CORBA/streamReadyHolder.java \
 	gnu/CORBA/streamRequest.java \
 	gnu/CORBA/stringTypeCode.java \
 	gnu/CORBA/stubFinder.java \
@@ -4303,6 +4305,7 @@
 	org/omg/CORBA/DynSequence.java \
 	org/omg/CORBA/DynStruct.java \
 	org/omg/CORBA/DynUnion.java \
+	org/omg/CORBA/DynValue.java \
 	org/omg/CORBA/DynamicImplementation.java \
 	org/omg/CORBA/Environment.java \
 	org/omg/CORBA/ExceptionList.java \
@@ -4390,6 +4393,7 @@
 	org/omg/CORBA/UShortSeqHelper.java \
 	org/omg/CORBA/UShortSeqHolder.java \
 	org/omg/CORBA/UnionMember.java \
+	org/omg/CORBA/UnknownUserException.java \
 	org/omg/CORBA/UserException.java \
 	org/omg/CORBA/VM_ABSTRACT.java \
 	org/omg/CORBA/VM_CUSTOM.java \
Index: kaffe/libraries/javalib/Makefile.in
diff -u kaffe/libraries/javalib/Makefile.in:1.447 kaffe/libraries/javalib/Makefile.in:1.448
--- kaffe/libraries/javalib/Makefile.in:1.447	Thu May 26 10:24:27 2005
+++ kaffe/libraries/javalib/Makefile.in	Mon May 30 02:21:03 2005
@@ -735,6 +735,7 @@
 	gnu/CORBA/OctetHolder.java \
 	gnu/CORBA/Restricted_ORB.java \
 	gnu/CORBA/ServiceDetailHolder.java \
+	gnu/CORBA/ServiceRequestAdapter.java \
 	gnu/CORBA/Simple_delegate.java \
 	gnu/CORBA/TypeCodeHelper.java \
 	gnu/CORBA/Unexpected.java \
@@ -760,6 +761,7 @@
 	gnu/CORBA/primitiveTypeCode.java \
 	gnu/CORBA/recordTypeCode.java \
 	gnu/CORBA/recursiveTypeCode.java \
+	gnu/CORBA/streamReadyHolder.java \
 	gnu/CORBA/streamRequest.java \
 	gnu/CORBA/stringTypeCode.java \
 	gnu/CORBA/stubFinder.java \
@@ -4918,6 +4920,7 @@
 	org/omg/CORBA/DynSequence.java \
 	org/omg/CORBA/DynStruct.java \
 	org/omg/CORBA/DynUnion.java \
+	org/omg/CORBA/DynValue.java \
 	org/omg/CORBA/DynamicImplementation.java \
 	org/omg/CORBA/Environment.java \
 	org/omg/CORBA/ExceptionList.java \
@@ -5005,6 +5008,7 @@
 	org/omg/CORBA/UShortSeqHelper.java \
 	org/omg/CORBA/UShortSeqHolder.java \
 	org/omg/CORBA/UnionMember.java \
+	org/omg/CORBA/UnknownUserException.java \
 	org/omg/CORBA/UserException.java \
 	org/omg/CORBA/VM_ABSTRACT.java \
 	org/omg/CORBA/VM_CUSTOM.java \
Index: kaffe/libraries/javalib/all.files
diff -u kaffe/libraries/javalib/all.files:1.130 kaffe/libraries/javalib/all.files:1.131
--- kaffe/libraries/javalib/all.files:1.130	Thu May 26 10:24:30 2005
+++ kaffe/libraries/javalib/all.files	Mon May 30 02:21:04 2005
@@ -138,7 +138,9 @@
 gnu/CORBA/recursiveTypeCode.java
 gnu/CORBA/Restricted_ORB.java
 gnu/CORBA/ServiceDetailHolder.java
+gnu/CORBA/ServiceRequestAdapter.java
 gnu/CORBA/Simple_delegate.java
+gnu/CORBA/streamReadyHolder.java
 gnu/CORBA/streamRequest.java
 gnu/CORBA/stringTypeCode.java
 gnu/CORBA/stubFinder.java
@@ -3696,6 +3698,7 @@
 org/omg/CORBA/DynSequence.java
 org/omg/CORBA/DynStruct.java
 org/omg/CORBA/DynUnion.java
+org/omg/CORBA/DynValue.java
 org/omg/CORBA/Environment.java
 org/omg/CORBA/ExceptionList.java
 org/omg/CORBA/FixedHolder.java
@@ -3796,6 +3799,7 @@
 org/omg/CORBA/ULongSeqHolder.java
 org/omg/CORBA/UnionMember.java
 org/omg/CORBA/UNKNOWN.java
+org/omg/CORBA/UnknownUserException.java
 org/omg/CORBA/UNSUPPORTED_POLICY.java
 org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.java
 org/omg/CORBA/UserException.java
Index: kaffe/libraries/javalib/gnu/CORBA/Functional_ORB.java
diff -u kaffe/libraries/javalib/gnu/CORBA/Functional_ORB.java:1.2 kaffe/libraries/javalib/gnu/CORBA/Functional_ORB.java:1.3
--- kaffe/libraries/javalib/gnu/CORBA/Functional_ORB.java:1.2	Thu May 26 10:24:31 2005
+++ kaffe/libraries/javalib/gnu/CORBA/Functional_ORB.java	Mon May 30 02:21:08 2005
@@ -113,6 +113,12 @@
     ServerSocket service;
 
     /**
+     * True if the serving node must shutdown due
+     * call of the close_now().
+     */
+    boolean terminated;
+
+    /**
      * Create a new portServer, serving on specific port.
      */
     portServer(int _port)
@@ -127,8 +133,6 @@
      */
     public void run()
     {
-      boolean terminated;
-
       try
         {
           service = new ServerSocket(s_port);
@@ -146,11 +150,12 @@
             }
           catch (SocketException ex)
             {
-              // Thrown when the service is closed by
+              // May be thrown when the service is closed by
               // the close_now().
-              return;
+              if (terminated)
+                return;
             }
-          catch (IOException iex)
+          catch (Exception iex)
             {
               // Wait 5 seconds. Do not terminate the
               // service due potentially transient error.
@@ -172,6 +177,7 @@
     {
       try
         {
+          terminated = true;
           service.close();
         }
       catch (Exception ex)
@@ -217,11 +223,57 @@
   public static final String NAME_SERVICE = "NameService";
 
   /**
+   * The if the client has once opened a socket, it should start sending
+   * the message header in a given time. Otherwise the server will close the
+   * socket. This prevents server hang when the client opens the socket,
+   * but does not send any message, usually due crash on the client side.
+   */
+  public static String START_READING_MESSAGE =
+      "gnu.classpath.CORBA.TOUT_START_READING_MESSAGE";
+
+  /**
+   * If the client has started to send the request message, the socket time
+   * out changes to the specified value.
+   */
+  public static String WHILE_READING =
+      "gnu.classpath.CORBA.TOUT_WHILE_READING";
+
+  /**
+   * If the message body is received, the time out changes to the
+   * specifice value. This must be longer, as includes time, required to
+   * process the received task. We make it 40 minutes.
+   */
+  public static String AFTER_RECEIVING =
+      "gnu.classpath.CORBA.TOUT_AFTER_RECEIVING";
+
+  /**
    * The address of the local host.
    */
   public final String LOCAL_HOST;
 
   /**
+   * The if the client has once opened a socket, it should start sending
+   * the message header in a given time. Otherwise the server will close the
+   * socket. This prevents server hang when the client opens the socket,
+   * but does not send any message, usually due crash on the client side.
+   */
+  private int TOUT_START_READING_MESSAGE = 20*1000;
+  // (Here and below, we use * to make meaning of the constant clearler).
+
+  /**
+   * If the client has started to send the request message, the socket time
+   * out changes to the specified value.
+   */
+  private int TOUT_WHILE_READING = 2*60*1000;
+
+  /**
+   * If the message body is received, the time out changes to the
+   * specifice value. This must be longer, as includes time, required to
+   * process the received task. We make it 40 minutes.
+   */
+  private int TOUT_AFTER_RECEIVING = 40*60*1000;
+
+  /**
    * The map of the already conncted objects.
    */
   protected final Connected_objects connected_objects = new Connected_objects();
@@ -820,6 +872,15 @@
             if (para [ i ] [ 0 ].equals(NS_HOST))
               ns_host = para [ i ] [ 1 ];
 
+            if (para [ i ] [ 0 ].equals(START_READING_MESSAGE))
+              TOUT_START_READING_MESSAGE = Integer.parseInt(para [ i ] [ 1 ]);
+
+            if (para [ i ] [ 0 ].equals(WHILE_READING))
+              TOUT_WHILE_READING = Integer.parseInt(para [ i ] [ 1 ]);
+
+            if (para [ i ] [ 0 ].equals(AFTER_RECEIVING))
+              TOUT_AFTER_RECEIVING = Integer.parseInt(para [ i ] [ 1 ]);
+
             try
               {
                 if (para [ i ] [ 0 ].equals(NS_PORT))
@@ -1016,9 +1077,8 @@
     try
       {
         service = serverSocket.accept();
-        service.setKeepAlive(true);
-
         InputStream in = service.getInputStream();
+        service.setSoTimeout(TOUT_START_READING_MESSAGE);
 
         MessageHeader msh_request = new MessageHeader();
         msh_request.read(in);
@@ -1031,7 +1091,6 @@
             {
               OutputStream out = service.getOutputStream();
               new ErrorMessage(max_version).write(out);
-              service.close();
               return;
             }
 
@@ -1039,12 +1098,18 @@
 
         int n = 0;
 
+        service.setSoTimeout(TOUT_WHILE_READING);
+
         reading:
         while (n < r.length)
           {
             n = in.read(r, n, r.length - n);
           }
 
+        service.shutdownInput();
+
+        service.setSoTimeout(TOUT_AFTER_RECEIVING);
+
         if (msh_request.message_type == MessageHeader.REQUEST)
           {
             RequestHeader rh_request;
@@ -1140,6 +1205,18 @@
           {
             if (props.containsKey(NS_PORT))
               ns_port = Integer.parseInt(props.getProperty(NS_PORT));
+
+            if (props.containsKey(START_READING_MESSAGE))
+              TOUT_START_READING_MESSAGE =
+                Integer.parseInt(props.getProperty(START_READING_MESSAGE));
+
+            if (props.containsKey(WHILE_READING))
+              TOUT_WHILE_READING =
+                Integer.parseInt(props.getProperty(WHILE_READING));
+
+            if (props.containsKey(AFTER_RECEIVING))
+              TOUT_AFTER_RECEIVING =
+                Integer.parseInt(props.getProperty(AFTER_RECEIVING));
           }
         catch (NumberFormatException ex)
           {
===================================================================
Checking out kaffe/libraries/javalib/gnu/CORBA/ServiceRequestAdapter.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/gnu/CORBA/ServiceRequestAdapter.java,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/libraries/javalib/gnu/CORBA/ServiceRequestAdapter.java	Mon May 30 02:25:42 2005
@@ -0,0 +1,159 @@
+/* ServiceRequestConverter.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., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 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.CORBA;
+
+import gnu.CORBA.CDR.cdrBufOutput;
+
+import org.omg.CORBA.ARG_IN;
+import org.omg.CORBA.ARG_INOUT;
+import org.omg.CORBA.ARG_OUT;
+import org.omg.CORBA.Any;
+import org.omg.CORBA.Bounds;
+import org.omg.CORBA.ServerRequest;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.InvokeHandler;
+import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.ResponseHandler;
+import org.omg.CORBA.portable.Streamable;
+
+/**
+ * This class exists to handle obsolete invocation style using
+ * ServerRequest.
+ *
+ * @deprecated The method {@link ObjectImpl#_invoke} is much faster.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA at Bioinformatics.org)
+ */
+public class ServiceRequestAdapter
+  implements ResponseHandler
+{
+  /**
+   * A buffer for writing the response.
+   */
+  cdrBufOutput reply = new cdrBufOutput();
+
+  /**
+   * If set to true, an exception has been thrown during the invocation.
+   */
+  boolean isException;
+
+  public OutputStream createExceptionReply()
+  {
+    isException = true;
+    return reply;
+  }
+
+  public OutputStream createReply()
+  {
+    isException = false;
+    return reply;
+  }
+
+  /**
+   * The old style invocation using the currently deprecated server
+   * request class.
+   *
+   * @param request a server request, containg the invocation information.
+   * @param target the invocation target
+   * @param result the result holder with the set suitable streamable to read
+   * the result or null for void.
+   */
+  public static void invoke(ServerRequest request, InvokeHandler target,
+                            Streamable result
+                           )
+  {
+    try
+      {
+        int IN = ARG_IN.value;
+        int OUT = ARG_OUT.value;
+
+        // Write all arguments to the buffer output stream.
+        cdrBufOutput buffer = new cdrBufOutput();
+        gnuNVList args = new gnuNVList();
+        request.arguments(args);
+
+        for (int i = 0; i < args.count(); i++)
+          {
+            if ((args.item(i).flags() & IN) != 0)
+              {
+                args.item(i).value().write_value(buffer);
+              }
+          }
+
+        ServiceRequestAdapter h = new ServiceRequestAdapter();
+
+        target._invoke(request.operation(), buffer.create_input_stream(), h);
+
+        InputStream in = h.reply.create_input_stream();
+
+        if (h.isException)
+          {
+            // Write the exception information
+            gnuAny exc = new gnuAny();
+            universalHolder uku = new universalHolder(h.reply);
+            exc.insert_Streamable(uku);
+            request.set_exception(exc);
+          }
+        else
+          {
+            if (result != null)
+            {
+              result._read(in);
+              gnuAny r = new gnuAny();
+              r.insert_Streamable(result);
+              request.set_result(r);
+            };
+
+            // Unpack the arguments
+            for (int i = 0; i < args.count(); i++)
+              {
+                if ((args.item(i).flags() & OUT) != 0)
+                  {
+                    Any a = args.item(i).value();
+                    a.read_value(in, a.type());
+                  }
+              }
+          }
+      }
+    catch (Bounds ex)
+      {
+        throw new InternalError();
+      }
+  }
+}
\ No newline at end of file
Index: kaffe/libraries/javalib/gnu/CORBA/gnuNVList.java
diff -u kaffe/libraries/javalib/gnu/CORBA/gnuNVList.java:1.1 kaffe/libraries/javalib/gnu/CORBA/gnuNVList.java:1.2
--- kaffe/libraries/javalib/gnu/CORBA/gnuNVList.java:1.1	Sun May 15 19:20:10 2005
+++ kaffe/libraries/javalib/gnu/CORBA/gnuNVList.java	Mon May 30 02:21:08 2005
@@ -74,13 +74,13 @@
   /** {@inheritDoc} */
   public NamedValue add(int a_flags)
   {
-    return add_value(null, null, a_flags);
+    return add_value(null, new gnuAny(), a_flags);
   }
 
   /** {@inheritDoc} */
   public NamedValue add_item(String a_name, int a_flags)
   {
-    return add_value(a_name, null, a_flags);
+    return add_value(a_name, new gnuAny(), a_flags);
   }
 
   /** {@inheritDoc} */
@@ -93,17 +93,17 @@
     list.add(n);
     return n;
   }
-  
+
   /**
    * Add the given named value to the list directly.
-   * 
+   *
    * @param value the named vaue to add.
    */
   public void add(NamedValue value)
   {
     list.add(value);
-  }  
-  
+  }
+
 
   /** {@inheritDoc} */
   public int count()
Index: kaffe/libraries/javalib/gnu/CORBA/gnuRequest.java
diff -u kaffe/libraries/javalib/gnu/CORBA/gnuRequest.java:1.2 kaffe/libraries/javalib/gnu/CORBA/gnuRequest.java:1.3
--- kaffe/libraries/javalib/gnu/CORBA/gnuRequest.java:1.2	Thu May 26 10:24:31 2005
+++ kaffe/libraries/javalib/gnu/CORBA/gnuRequest.java	Mon May 30 02:21:08 2005
@@ -69,6 +69,7 @@
 import java.io.OutputStream;
 
 import java.net.Socket;
+import org.omg.CORBA.UnknownUserException;
 
 /**
  * The implementation of the CORBA request.
@@ -786,17 +787,15 @@
               input.align(8);
               align = false;
             }
-          input.mark(2000);
 
-          String uxId = input.read_string();
-          input.reset();
+          // Prepare an Any that will hold the exception.
+          gnuAny exc = new gnuAny();
 
-          UserException uex = ObjectCreator.readUserException(uxId, input);
+          exc.insert_Streamable(new streamReadyHolder(input));
+
+          UnknownUserException unuex = new UnknownUserException(exc);
+          m_environment.exception(unuex);
 
-          if (uex == null)
-            m_environment.exception(new UserException(uxId));
-          else
-            m_environment.exception(uex);
           break;
 
         case ReplyHeader.LOCATION_FORWARD_PERM :
===================================================================
Checking out kaffe/libraries/javalib/gnu/CORBA/streamReadyHolder.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/gnu/CORBA/streamReadyHolder.java,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/libraries/javalib/gnu/CORBA/streamReadyHolder.java	Mon May 30 02:25:43 2005
@@ -0,0 +1,120 @@
+/* streamReadyHolder.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., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 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.CORBA;
+
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.NO_IMPLEMENT;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
+
+import java.io.IOException;
+
+/**
+ * A holder that stores the input stream, from that the holder data
+ * can be read. There is no way to write the data into this holder.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA at Bioinformatics.org)
+ */
+public class streamReadyHolder
+  implements Streamable
+{
+  /**
+   * The stream, holding the data for this holder.
+   */
+  protected final InputStream stream;
+
+  /**
+   * Create a holder that will read from the given stream.
+   *
+   * @param a_stream a stream.
+   */
+  public streamReadyHolder(InputStream a_stream)
+  {
+    stream = a_stream;
+  }
+
+  /**
+   * This method is not in use, should never be called.
+   */
+  public TypeCode _type()
+  {
+    throw new NO_IMPLEMENT();
+  }
+
+  /**
+   * Writes the data from the stored stream into the provided
+   * output stream till the end of the input stream is reached.
+   *
+   * @throws MARSHAL if the IOException is thrown during operation.
+   */
+  public void _write(OutputStream output)
+  {
+    try
+      {
+        int d = stream.read();
+
+        while (d >= 0)
+          {
+            output.write(d);
+            d = stream.read();
+          }
+      }
+    catch (IOException ex)
+      {
+        throw new MARSHAL(ex + ":" + ex.getMessage());
+      }
+  }
+
+  /**
+   * This method is not in use, should never be called.
+   */
+  public void _read(InputStream input)
+  {
+    throw new NO_IMPLEMENT();
+  }
+
+  /**
+   * Get the input stream that has been passed in constructor.
+   */
+  InputStream getInputStream()
+  {
+    return stream;
+  }
+}
\ No newline at end of file
===================================================================
Checking out kaffe/libraries/javalib/org/omg/CORBA/DynValue.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/org/omg/CORBA/DynValue.java,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/libraries/javalib/org/omg/CORBA/DynValue.java	Mon May 30 02:25:43 2005
@@ -0,0 +1,82 @@
+/* DynValue.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., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 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 org.omg.CORBA;
+
+/**
+ * Represents the {@link DynAny}, holding a value type.
+ *
+ * A value type is something between CORBA structure and CORBA object.
+ * Like CORBA object, it can have methods, supporting some IDL-defined
+ * interface. However, like structures, they are always local and passed by
+ * value, not by IOR reference.
+ *
+ * The value types can have both public and private members. They support
+ * inheritance. Value types can also be abstract.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA at Bioinformatics.org)
+ */
+public interface DynValue
+{
+  /**
+   * Get the kind of the member, pointed by the internal pointer.
+   *
+   * @return the kind of the member.
+   */
+  TCKind current_member_kind();
+
+  /**
+   * Get the name of the member, pointed by the internal pointer.
+   *
+   * @return the name of the member.
+   */
+  String current_member_name();
+
+  /**
+   * Get all members of the enclosed value type object.
+   * @return
+   */
+  NameValuePair[] get_members();
+
+  /**
+   * Set all members for the enclosed value type object.
+   *
+   * @param value an array of members to set.
+   */
+  void set_members(NameValuePair[] value);
+}
Index: kaffe/libraries/javalib/org/omg/CORBA/ORB.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/ORB.java:1.4 kaffe/libraries/javalib/org/omg/CORBA/ORB.java:1.5
--- kaffe/libraries/javalib/org/omg/CORBA/ORB.java:1.4	Thu May 26 10:24:33 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/ORB.java	Mon May 30 02:21:08 2005
@@ -39,6 +39,7 @@
 package org.omg.CORBA;
 
 import gnu.CORBA.Restricted_ORB;
+import gnu.CORBA.primitiveTypeCode;
 import gnu.CORBA.fixedTypeCode;
 import gnu.CORBA.generalTypeCode;
 import gnu.CORBA.gnuContext;
@@ -194,6 +195,7 @@
    * @throws NO_IMPLEMENT, always.
    */
   public DynAny create_basic_dyn_any(org.omg.CORBA.TypeCode t)
+                             throws InconsistentTypeCode
   {
     throw new NO_IMPLEMENT();
   };
@@ -209,7 +211,6 @@
    * @throws NO_IMPLEMENT, always.
    */
   public DynAny create_dyn_any(org.omg.CORBA.Any a)
-                       throws InconsistentTypeCode
   {
     throw new NO_IMPLEMENT();
   };
@@ -444,6 +445,25 @@
   public abstract org.omg.CORBA.portable.OutputStream create_output_stream();
 
   /**
+   * This should create the list, initialised with the argument descriptions
+   * for the given operation definition (CORBA <code>OperationDef</code>).
+   * The information should be obtained from the interface repository.
+   * However this method is oficially documented as not implemented at least
+   * till v1.4 inclusive.
+   *
+   * @param peration_definition the operation definition, must be
+   * CORBA <code>OperationDef</code>.
+   *
+   * @return never
+   *
+   * @throws NO_IMPLEMENT, always.
+   */
+  public NVList create_operation_list(Object operation_definition)
+  {
+    throw new NO_IMPLEMENT();
+  }
+
+  /**
    * This should create the new policy with the specified type and initial
    * state. The policies and methods for getting them are not implemented till
    * v1.4 inclusive.
@@ -461,6 +481,8 @@
     throw new NO_IMPLEMENT();
   }
 
+
+
   /**
    * Create typecode, defining the sequence of the elements, having
    * the given type.
@@ -523,6 +545,78 @@
    */
   public abstract TypeCode create_wstring_tc(int bound);
 
+
+  /**
+   * Create a typecode for an abstract interface. The abstract interface
+   * can be either CORBA object or CORBA value type.
+   *
+   * @param id the id of the abstract interface.
+   * @param name the name of the abstract interface.
+   *
+   * @return the created typecode.
+   */
+  public TypeCode create_abstract_interface_tc(String id, String name)
+  {
+    generalTypeCode t = new generalTypeCode(TCKind.tk_abstract_interface);
+    t.setName(name);
+    t.setId(id);
+    return t;
+  }
+
+  /**
+   * Create a typecode for a native interface.
+   *
+   * @param id the id of the native interface.
+   * @param name the name of the native interface.
+   *
+   * @return the created typecode.
+   */
+  public TypeCode create_native_tc(String id, String name)
+  {
+    generalTypeCode t = new generalTypeCode(TCKind.tk_native);
+    t.setName(name);
+    t.setId(id);
+    return t;
+  }
+
+  /**
+   * Create a typecode, representing a tree-like structure.
+   * This structure contains a member that is a sequence of the same type,
+   * as the structure itself. You can imagine as if the folder definition
+   * contains a variable-length array of the enclosed (nested) folder
+   * definitions. In this way, it is possible to have a tree like
+   * structure that can be transferred via CORBA CDR stream.
+   *
+   * @deprecated It is easier and clearler to use a combination of
+   * create_recursive_tc and create_sequence_tc instead.
+   *
+   * @param bound the maximal expected number of the nested components
+   * on each node; 0 if not limited.
+   *
+   * @param offset the position of the field in the returned structure
+   * that contains the sequence of the structures of the same field.
+   * The members before this field are intialised using parameterless
+   * StructMember constructor.
+   *
+   * @return a typecode, defining a stucture, where a member at the
+   * <code>offset</code> position defines an array of the identical
+   * structures.
+   *
+   * @see #create_recursive_tc(String)
+   * @see #create_sequence_tc(int, TypeCode)
+   */
+  public TypeCode create_recursive_sequence_tc(int bound, int offset)
+  {
+    recordTypeCode r = new recordTypeCode(TCKind.tk_struct);
+    for (int i = 0; i < offset; i++)
+      r.add(new StructMember());
+
+    TypeCode recurs = new primitiveTypeCode(TCKind.tk_sequence);
+
+    r.add(new StructMember("", recurs, null));
+    return r;
+  }
+
   /**
    * Create a typecode which serves as a placeholder for typcode, containing
    * recursion.
@@ -583,6 +677,29 @@
    * @throws NO_IMPLEMENT, always.
    */
   public Current get_current()
+  {
+    throw new NO_IMPLEMENT();
+  }
+
+  /**
+   * This should return the information about the CORBA facilities and
+   * services, available from this ORB. However this method is oficially
+   * documented as not implemented at least till v1.4 inclusive.
+   *
+   * @param service_type a type of the service being requested. The OMG
+   * specification currently defines only one value, 1, for security
+   * related services.
+   *
+   * @param service_info a holder, where the returned information should
+   * be stored.
+   *
+   * @return should return true if the service information is available
+   * from the ORB, but this method never returns.
+   *
+   * @throws NO_IMPLEMENT, always.

*** Patch too long, truncated ***




More information about the kaffe mailing list