1. /*
  2. * @(#)NotFoundHelper.java 1.10 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. /*
  11. * File: ./org/omg/CosNaming/NamingContextPackage/NotFoundHelper.java
  12. * From: nameservice.idl
  13. * Date: Tue Aug 11 03:12:09 1998
  14. * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18
  15. */
  16. package org.omg.CosNaming.NamingContextPackage;
  17. public class NotFoundHelper {
  18. // It is useless to have instances of this class
  19. private NotFoundHelper() { }
  20. public static void write(org.omg.CORBA.portable.OutputStream out, org.omg.CosNaming.NamingContextPackage.NotFound that) {
  21. out.write_string(id());
  22. org.omg.CosNaming.NamingContextPackage.NotFoundReasonHelper.write(out, that.why);
  23. {
  24. out.write_long(that.rest_of_name.length);
  25. for (int __index = 0 ; __index < that.rest_of_name.length ; __index += 1) {
  26. org.omg.CosNaming.NameComponentHelper.write(out, that.rest_of_name[__index]);
  27. }
  28. }
  29. }
  30. public static org.omg.CosNaming.NamingContextPackage.NotFound read(org.omg.CORBA.portable.InputStream in) {
  31. org.omg.CosNaming.NamingContextPackage.NotFound that = new org.omg.CosNaming.NamingContextPackage.NotFound();
  32. // read and discard the repository id
  33. in.read_string();
  34. that.why = org.omg.CosNaming.NamingContextPackage.NotFoundReasonHelper.read(in);
  35. {
  36. int __length = in.read_long();
  37. that.rest_of_name = new org.omg.CosNaming.NameComponent[__length];
  38. for (int __index = 0 ; __index < that.rest_of_name.length ; __index += 1) {
  39. that.rest_of_name[__index] = org.omg.CosNaming.NameComponentHelper.read(in);
  40. }
  41. }
  42. return that;
  43. }
  44. public static org.omg.CosNaming.NamingContextPackage.NotFound extract(org.omg.CORBA.Any a) {
  45. org.omg.CORBA.portable.InputStream in = a.create_input_stream();
  46. return read(in);
  47. }
  48. public static void insert(org.omg.CORBA.Any a, org.omg.CosNaming.NamingContextPackage.NotFound that) {
  49. org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
  50. write(out, that);
  51. a.read_value(out.create_input_stream(), type());
  52. }
  53. private static org.omg.CORBA.TypeCode _tc;
  54. synchronized public static org.omg.CORBA.TypeCode type() {
  55. int _memberCount = 2;
  56. org.omg.CORBA.StructMember[] _members = null;
  57. if (_tc == null) {
  58. _members= new org.omg.CORBA.StructMember[2];
  59. _members[0] = new org.omg.CORBA.StructMember(
  60. "why",
  61. org.omg.CosNaming.NamingContextPackage.NotFoundReasonHelper.type(),
  62. null);
  63. _members[1] = new org.omg.CORBA.StructMember(
  64. "rest_of_name",
  65. org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CosNaming.NameComponentHelper.type()),
  66. null);
  67. _tc = org.omg.CORBA.ORB.init().create_exception_tc(id(), "NotFound", _members);
  68. }
  69. return _tc;
  70. }
  71. public static String id() {
  72. return "IDL:omg.org/CosNaming/NamingContext/NotFound:1.0";
  73. }
  74. }