40 |
|
|
41 |
import gnu.CORBA.CDR.gnuRuntime; |
import gnu.CORBA.CDR.gnuRuntime; |
42 |
|
|
43 |
|
import org.omg.CORBA.BAD_PARAM; |
44 |
import org.omg.CORBA.CustomMarshal; |
import org.omg.CORBA.CustomMarshal; |
45 |
|
import org.omg.CORBA.portable.OutputStream; |
46 |
import org.omg.CORBA.portable.Streamable; |
import org.omg.CORBA.portable.Streamable; |
47 |
import org.omg.SendingContext.RunTime; |
import org.omg.SendingContext.RunTime; |
48 |
|
|
52 |
import java.rmi.Remote; |
import java.rmi.Remote; |
53 |
|
|
54 |
import javax.rmi.CORBA.ValueHandler; |
import javax.rmi.CORBA.ValueHandler; |
55 |
|
import javax.rmi.CORBA.ValueHandlerMultiFormat; |
56 |
|
|
57 |
/** |
/** |
58 |
* Implementation of the ValueHandler. |
* Implementation of the ValueHandler. |
61 |
*/ |
*/ |
62 |
public class ValueHandlerDelegateImpl |
public class ValueHandlerDelegateImpl |
63 |
extends gnuRmiUtil |
extends gnuRmiUtil |
64 |
implements ValueHandler |
implements ValueHandler, ValueHandlerMultiFormat |
65 |
{ |
{ |
66 |
|
/** |
67 |
|
* Return the maximal supported stream format version. We currently |
68 |
|
* support the version 1. |
69 |
|
* |
70 |
|
* TODO Support the version 2. |
71 |
|
*/ |
72 |
|
public byte getMaximumStreamFormatVersion() |
73 |
|
{ |
74 |
|
return 1; |
75 |
|
} |
76 |
|
|
77 |
|
/** |
78 |
|
* Write value using the given stream format version. |
79 |
|
*/ |
80 |
|
public void writeValue(OutputStream output, Serializable value, byte version) |
81 |
|
{ |
82 |
|
if (version!=1) |
83 |
|
throw new BAD_PARAM("Unsupported stream format version "+version); |
84 |
|
else |
85 |
|
writeValue(output, value); |
86 |
|
} |
87 |
|
|
88 |
/** |
/** |
89 |
* This implementation associates RunTime with stream rather than with the |
* This implementation associates RunTime with stream rather than with the |
90 |
* value handler and this method is not used in the implementation. It is |
* value handler and this method is not used in the implementation. It is |