01: /*
02: * Copyright 2000-2003 Sun Microsystems, Inc. All Rights Reserved.
03: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04: *
05: * This code is free software; you can redistribute it and/or modify it
06: * under the terms of the GNU General Public License version 2 only, as
07: * published by the Free Software Foundation. Sun designates this
08: * particular file as subject to the "Classpath" exception as provided
09: * by Sun in the LICENSE file that accompanied this code.
10: *
11: * This code is distributed in the hope that it will be useful, but WITHOUT
12: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14: * version 2 for more details (a copy is included in the LICENSE file that
15: * accompanied this code).
16: *
17: * You should have received a copy of the GNU General Public License version
18: * 2 along with this work; if not, write to the Free Software Foundation,
19: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20: *
21: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22: * CA 95054 USA or visit www.sun.com if you need additional information or
23: * have any questions.
24: */
25:
26: package com.sun.corba.se.impl.dynamicany;
27:
28: import org.omg.CORBA.Any;
29: import org.omg.CORBA.LocalObject;
30: import org.omg.CORBA.TypeCode;
31: import org.omg.CORBA.TCKind;
32:
33: import org.omg.DynamicAny.*;
34: import org.omg.DynamicAny.DynAnyFactoryPackage.*;
35:
36: import com.sun.corba.se.spi.orb.ORB;
37: import com.sun.corba.se.spi.logging.CORBALogDomains;
38: import com.sun.corba.se.impl.logging.ORBUtilSystemException;
39:
40: public class DynAnyFactoryImpl extends org.omg.CORBA.LocalObject
41: implements org.omg.DynamicAny.DynAnyFactory {
42: //
43: // Instance variables
44: //
45:
46: private ORB orb;
47:
48: //
49: // Constructors
50: //
51:
52: private DynAnyFactoryImpl() {
53: this .orb = null;
54: }
55:
56: public DynAnyFactoryImpl(ORB orb) {
57: this .orb = orb;
58: }
59:
60: //
61: // DynAnyFactory interface methods
62: //
63:
64: // Returns the most derived DynAny type based on the Anys TypeCode.
65: public org.omg.DynamicAny.DynAny create_dyn_any(
66: org.omg.CORBA.Any any)
67: throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode {
68: return DynAnyUtil.createMostDerivedDynAny(any, orb, true);
69: }
70:
71: // Returns the most derived DynAny type based on the TypeCode.
72: public org.omg.DynamicAny.DynAny create_dyn_any_from_type_code(
73: org.omg.CORBA.TypeCode type)
74: throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode {
75: return DynAnyUtil.createMostDerivedDynAny(type, orb);
76: }
77:
78: // Needed for org.omg.CORBA.Object
79:
80: private String[] __ids = { "IDL:omg.org/DynamicAny/DynAnyFactory:1.0" };
81:
82: public String[] _ids() {
83: return __ids;
84: }
85: }
|