summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/gnu/CORBA/ServiceRequestAdapter.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/gnu/CORBA/ServiceRequestAdapter.java')
-rw-r--r--libjava/classpath/gnu/CORBA/ServiceRequestAdapter.java37
1 files changed, 23 insertions, 14 deletions
diff --git a/libjava/classpath/gnu/CORBA/ServiceRequestAdapter.java b/libjava/classpath/gnu/CORBA/ServiceRequestAdapter.java
index 0b698818215..7f40fc84d2d 100644
--- a/libjava/classpath/gnu/CORBA/ServiceRequestAdapter.java
+++ b/libjava/classpath/gnu/CORBA/ServiceRequestAdapter.java
@@ -53,10 +53,11 @@ 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.
+ * This class supports invocation using ServerRequest. When possible,
+ * it is better to use the {@link ObjectImpl#_invoke} rather than
+ * working via ServerRequest. However since 1.4 the ServerRequest is
+ * involved into POA machinery making this type of call is sometimes
+ * inavoidable.
*
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
*/
@@ -86,13 +87,13 @@ public class ServiceRequestAdapter
}
/**
- * The old style invocation using the currently deprecated server
- * request class.
+ * Make an invocation.
*
* @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.
+ * @param result the result holder with the set suitable streamable.
+ * Using this parameter only increase the performance. It can be
+ * null if the return type is void or unknown.
*/
public static void invoke(ServerRequest request, InvokeHandler target,
Streamable result
@@ -133,12 +134,20 @@ public class ServiceRequestAdapter
else
{
if (result != null)
- {
- result._read(in);
- gnuAny r = new gnuAny();
- r.insert_Streamable(result);
- request.set_result(r);
- };
+ {
+ // Use the holder for the return value, if provided.
+ result._read(in);
+
+ gnuAny r = new gnuAny();
+ r.insert_Streamable(result);
+ request.set_result(r);
+ }
+ else
+ {
+ // Use the universal holder otherwise.
+ gnuAny r = new gnuAny();
+ r.insert_Streamable(new streamReadyHolder(in));
+ }
// Unpack the arguments
for (int i = 0; i < args.count(); i++)
OpenPOWER on IntegriCloud