/[classpath]/classpath/gnu/CORBA/IOR.java
ViewVC logotype

Diff of /classpath/gnu/CORBA/IOR.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.5 by gnu_andrew, Sat Sep 10 15:31:35 2005 UTC revision 1.1.2.6 by gnu_andrew, Wed Nov 2 00:43:22 2005 UTC
# Line 38  exception statement from your version. * Line 38  exception statement from your version. *
38    
39  package gnu.CORBA;  package gnu.CORBA;
40    
41  import gnu.CORBA.CDR.cdrBufInput;  import gnu.CORBA.CDR.BufferredCdrInput;
42  import gnu.CORBA.CDR.cdrBufOutput;  import gnu.CORBA.CDR.BufferedCdrOutput;
43  import gnu.CORBA.CDR.cdrInput;  import gnu.CORBA.CDR.AbstractCdrInput;
44  import gnu.CORBA.CDR.cdrOutput;  import gnu.CORBA.CDR.AbstractCdrOutput;
45  import gnu.CORBA.GIOP.CharSets_OSF;  import gnu.CORBA.GIOP.CharSets_OSF;
46  import gnu.CORBA.GIOP.cxCodeSet;  import gnu.CORBA.GIOP.CodeSetServiceContext;
47    
48  import org.omg.CORBA.BAD_PARAM;  import org.omg.CORBA.BAD_PARAM;
49  import org.omg.CORBA.CompletionStatus;  import org.omg.CORBA.CompletionStatus;
# Line 174  public class IOR Line 174  public class IOR
174       * The negotiated coding result for this IOR. Saves time, requred for       * The negotiated coding result for this IOR. Saves time, requred for
175       * negotiation computations.       * negotiation computations.
176       */       */
177      public cxCodeSet negotiated;      public CodeSetServiceContext negotiated;
178    
179      /**      /**
180       * Read the code set profile information from the given input stream.       * Read the code set profile information from the given input stream.
181       *       *
182       * @param profile a stream to read from.       * @param profile a stream to read from.
183       */       */
184      public void read(cdrInput profile)      public void read(AbstractCdrInput profile)
185      {      {
186        cdrBufInput encapsulation = profile.read_encapsulation();        BufferredCdrInput encapsulation = profile.read_encapsulation();
187        narrow.read(encapsulation);        narrow.read(encapsulation);
188        wide.read(encapsulation);        wide.read(encapsulation);
189      }      }
# Line 201  public class IOR Line 201  public class IOR
201       *       *
202       * @param profile a stream to write into.       * @param profile a stream to write into.
203       */       */
204      public void write(cdrOutput profile)      public void write(AbstractCdrOutput profile)
205      {      {
206        cdrOutput encapsulation = profile.createEncapsulation();        AbstractCdrOutput encapsulation = profile.createEncapsulation();
207        narrow.write(encapsulation);        narrow.write(encapsulation);
208        wide.write(encapsulation);        wide.write(encapsulation);
209        try        try
# Line 274  public class IOR Line 274  public class IOR
274      /**      /**
275       * Write the internet profile (except the heading tag.       * Write the internet profile (except the heading tag.
276       */       */
277      public void write(cdrOutput out)      public void write(AbstractCdrOutput out)
278      {      {
279        try        try
280          {          {
281            // Need to write the Internet profile into the separate            // Need to write the Internet profile into the separate
282            // stream as we must know the size in advance.            // stream as we must know the size in advance.
283            cdrOutput b = out.createEncapsulation();            AbstractCdrOutput b = out.createEncapsulation();
284    
285            version.write(b);            version.write(b);
286            b.write_string(host);            b.write_string(host);
# Line 310  public class IOR Line 310  public class IOR
310        catch (Exception e)        catch (Exception e)
311          {          {
312            MARSHAL m = new MARSHAL("Unable to write Internet profile.");            MARSHAL m = new MARSHAL("Unable to write Internet profile.");
313              m.minor = Minor.IOR;
314            m.initCause(e);            m.initCause(e);
315            throw m;            throw m;
316          }          }
# Line 392  public class IOR Line 393  public class IOR
393              buf.write(cx);              buf.write(cx);
394            }            }
395    
396          cdrBufInput cdr = new cdrBufInput(buf.toByteArray());          BufferredCdrInput cdr = new BufferredCdrInput(buf.toByteArray());
397    
398          r._read(cdr);          r._read(cdr);
399          return r;          return r;
# Line 411  public class IOR Line 412  public class IOR
412     * @param c a stream to read from.     * @param c a stream to read from.
413     * @throws IOException if the stream throws it.     * @throws IOException if the stream throws it.
414     */     */
415    public void _read(cdrInput c)    public void _read(AbstractCdrInput c)
416      throws IOException, BAD_PARAM      throws IOException, BAD_PARAM
417    {    {
418      int endian;      int endian;
# Line 433  public class IOR Line 434  public class IOR
434     * If the stream contains a null value, the Id and Internet fields become     * If the stream contains a null value, the Id and Internet fields become
435     * equal to null. Otherwise Id contains some string (possibly empty).     * equal to null. Otherwise Id contains some string (possibly empty).
436     *     *
437     * Id is checked for null in cdrInput that then returns null instead of     * Id is checked for null in AbstractCdrInput that then returns null instead of
438     * object.     * object.
439     *     *
440     * @param c a stream to read from.     * @param c a stream to read from.
441     * @throws IOException if the stream throws it.     * @throws IOException if the stream throws it.
442     */     */
443    public void _read_no_endian(cdrInput c)    public void _read_no_endian(AbstractCdrInput c)
444      throws IOException, BAD_PARAM      throws IOException, BAD_PARAM
445    {    {
446      Id = c.read_string();      Id = c.read_string();
# Line 456  public class IOR Line 457  public class IOR
457      for (int i = 0; i < n_profiles; i++)      for (int i = 0; i < n_profiles; i++)
458        {        {
459          int tag = c.read_long();          int tag = c.read_long();
460          cdrBufInput profile = c.read_encapsulation();          BufferredCdrInput profile = c.read_encapsulation();
461    
462          if (tag == Internet_profile.TAG_INTERNET_IOP)          if (tag == Internet_profile.TAG_INTERNET_IOP)
463            {            {
# Line 515  public class IOR Line 516  public class IOR
516     * Write this IOR record to the provided CDR stream. This procedure writes the     * Write this IOR record to the provided CDR stream. This procedure writes the
517     * zero (Big Endian) marker first.     * zero (Big Endian) marker first.
518     */     */
519    public void _write(cdrOutput out)    public void _write(AbstractCdrOutput out)
520    {    {
521      // Always use Big Endian.      // Always use Big Endian.
522      out.write(0);      out.write(0);
# Line 528  public class IOR Line 529  public class IOR
529     * The null value is written as defined in OMG specification (zero length     * The null value is written as defined in OMG specification (zero length
530     * string, followed by an empty set of profiles).     * string, followed by an empty set of profiles).
531     */     */
532    public static void write_null(cdrOutput out)    public static void write_null(AbstractCdrOutput out)
533    {    {
534      // Empty Id string.      // Empty Id string.
535      out.write_string("");      out.write_string("");
# Line 541  public class IOR Line 542  public class IOR
542     * Write this IOR record to the provided CDR stream. The procedure writed data     * Write this IOR record to the provided CDR stream. The procedure writed data
543     * in Big Endian, but does NOT add any endian marker to the beginning.     * in Big Endian, but does NOT add any endian marker to the beginning.
544     */     */
545    public void _write_no_endian(cdrOutput out)    public void _write_no_endian(AbstractCdrOutput out)
546    {    {
547      // Write repository id.      // Write repository id.
548      out.write_string(Id);      out.write_string(Id);
# Line 595  public class IOR Line 596  public class IOR
596     */     */
597    public String toStringifiedReference()    public String toStringifiedReference()
598    {    {
599      cdrBufOutput out = new cdrBufOutput();      BufferedCdrOutput out = new BufferedCdrOutput();
600    
601      _write(out);      _write(out);
602    
# Line 675  public class IOR Line 676  public class IOR
676          TaggedComponent[] present;          TaggedComponent[] present;
677          if (profile.profile_data.length > 0)          if (profile.profile_data.length > 0)
678            {            {
679              cdrBufInput in = new cdrBufInput(profile.profile_data);              BufferredCdrInput in = new BufferredCdrInput(profile.profile_data);
680    
681              present = new TaggedComponent[in.read_long()];              present = new TaggedComponent[in.read_long()];
682    
# Line 687  public class IOR Line 688  public class IOR
688          else          else
689            present = new TaggedComponent[0];            present = new TaggedComponent[0];
690    
691          cdrBufOutput out = new cdrBufOutput(profile.profile_data.length          BufferedCdrOutput out = new BufferedCdrOutput(profile.profile_data.length
692                                              + component.component_data.length                                              + component.component_data.length
693                                              + 8);                                              + 8);
694    

Legend:
Removed from v.1.1.2.5  
changed lines
  Added in v.1.1.2.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26