KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > PortableServer > ServantLocatorHelper


1 package org.omg.PortableServer;
2 public class ServantLocatorHelper
3 {
4     public ServantLocatorHelper()
5     {
6     }
7     public static void insert(org.omg.CORBA.Any JavaDoc any, org.omg.PortableServer.ServantLocator JavaDoc s)
8     {
9         any.insert_Object(s);
10     }
11     public static org.omg.PortableServer.ServantLocator JavaDoc extract(org.omg.CORBA.Any JavaDoc any)
12     {
13         return narrow(any.extract_Object());
14     }
15     public static org.omg.CORBA.TypeCode JavaDoc type()
16     {
17         return org.omg.CORBA.ORB.init().create_interface_tc( "IDL:omg.org/PortableServer/ServantLocator:1.0", "ServantLocator");
18     }
19     public static String JavaDoc id()
20     {
21         return "IDL:omg.org/PortableServer/ServantLocator:1.0";
22     }
23     public static ServantLocator JavaDoc read(org.omg.CORBA.portable.InputStream JavaDoc in)
24     {
25         return narrow( in.read_Object());
26     }
27     public static void write(org.omg.CORBA.portable.OutputStream JavaDoc _out, org.omg.PortableServer.ServantLocator JavaDoc s)
28     {
29         _out.write_Object(s);
30     }
31     public static org.omg.PortableServer.ServantLocator JavaDoc narrow(org.omg.CORBA.Object JavaDoc obj)
32     {
33         try
34         {
35             return (org.omg.PortableServer.ServantLocator JavaDoc)obj;
36         }
37         catch( ClassCastException JavaDoc c )
38         {
39             if( obj._is_a("IDL:omg.org/PortableServer/ServantLocator:1.0"))
40             {
41                 org.omg.PortableServer._ServantLocatorStub JavaDoc stub;
42                 stub = new org.omg.PortableServer._ServantLocatorStub JavaDoc();
43                 stub._set_delegate(((org.omg.CORBA.portable.ObjectImpl JavaDoc)obj)._get_delegate());
44                 return stub;
45             }
46         }
47         return null;
48     }
49     public void write_Object(org.omg.CORBA.portable.OutputStream JavaDoc _out, java.lang.Object JavaDoc obj)
50     {
51          throw new RuntimeException JavaDoc(" not implemented");
52     }
53     public java.lang.Object JavaDoc read_Object(org.omg.CORBA.portable.InputStream JavaDoc in)
54     {
55          throw new RuntimeException JavaDoc(" not implemented");
56     }
57     public String JavaDoc get_id()
58     {
59         return id();
60     }
61     public org.omg.CORBA.TypeCode JavaDoc get_type()
62     {
63         return type();
64     }
65 }
66
Popular Tags