KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > dynamicany > DynAnyFactoryImpl


1 /*
2  * @(#)DynAnyFactoryImpl.java 1.8 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.impl.dynamicany;
9
10 import org.omg.CORBA.Any JavaDoc;
11 import org.omg.CORBA.LocalObject JavaDoc;
12 import org.omg.CORBA.TypeCode JavaDoc;
13 import org.omg.CORBA.TCKind JavaDoc;
14
15 import org.omg.DynamicAny.*;
16 import org.omg.DynamicAny.DynAnyFactoryPackage.*;
17
18 import com.sun.corba.se.spi.orb.ORB ;
19 import com.sun.corba.se.spi.logging.CORBALogDomains ;
20 import com.sun.corba.se.impl.logging.ORBUtilSystemException ;
21
22 public class DynAnyFactoryImpl
23     extends org.omg.CORBA.LocalObject JavaDoc
24     implements org.omg.DynamicAny.DynAnyFactory JavaDoc
25 {
26     //
27
// Instance variables
28
//
29

30     private ORB orb;
31
32     //
33
// Constructors
34
//
35

36     private DynAnyFactoryImpl() {
37         this.orb = null;
38     }
39
40     public DynAnyFactoryImpl(ORB orb) {
41         this.orb = orb;
42     }
43
44     //
45
// DynAnyFactory interface methods
46
//
47

48     // Returns the most derived DynAny type based on the Anys TypeCode.
49
public org.omg.DynamicAny.DynAny JavaDoc create_dyn_any (org.omg.CORBA.Any JavaDoc any)
50         throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode JavaDoc
51     {
52         return DynAnyUtil.createMostDerivedDynAny(any, orb, true);
53     }
54
55     // Returns the most derived DynAny type based on the TypeCode.
56
public org.omg.DynamicAny.DynAny JavaDoc create_dyn_any_from_type_code (org.omg.CORBA.TypeCode JavaDoc type)
57         throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode JavaDoc
58     {
59         return DynAnyUtil.createMostDerivedDynAny(type, orb);
60     }
61
62     // Needed for org.omg.CORBA.Object
63

64     private String JavaDoc[] __ids = { "IDL:omg.org/DynamicAny/DynAnyFactory:1.0" };
65
66     public String JavaDoc[] _ids() {
67         return __ids;
68     }
69 }
70
Popular Tags