01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jboss.iiop.rmi.ir;
23:
24: import org.omg.CORBA.TypeCode;
25: import org.omg.CORBA.IDLTypeOperations;
26: import org.omg.CORBA.DefinitionKind;
27: import org.omg.CORBA.TypedefDef;
28: import org.omg.CORBA.TypedefDefOperations;
29: import org.omg.CORBA.TypedefDefHelper;
30: import org.omg.CORBA.TypedefDefPOATie;
31: import org.omg.CORBA.Any;
32: import org.omg.CORBA.TypeDescription;
33: import org.omg.CORBA.TypeDescriptionHelper;
34: import org.omg.CORBA.ContainedOperations;
35: import org.omg.CORBA.ContainedPackage.Description;
36:
37: import java.util.Map;
38: import java.util.HashMap;
39:
40: /**
41: * TypedefDef IR object.
42: *
43: * @author <a href="mailto:osh@sparre.dk">Ole Husgaard</a>
44: * @version $Revision: 57194 $
45: */
46: abstract class TypedefDefImpl extends ContainedImpl implements
47: TypedefDefOperations, LocalContainedIDLType {
48: // Constants -----------------------------------------------------
49:
50: // Attributes ----------------------------------------------------
51:
52: // Static --------------------------------------------------------
53:
54: // Constructors --------------------------------------------------
55:
56: TypedefDefImpl(String id, String name, String version,
57: LocalContainer defined_in, TypeCode typeCode,
58: DefinitionKind def_kind, RepositoryImpl repository) {
59: super (id, name, version, defined_in, def_kind, repository);
60:
61: this .typeCode = typeCode;
62: }
63:
64: // Public --------------------------------------------------------
65:
66: // ContainedImpl implementation ----------------------------------
67:
68: public Description describe() {
69: String defined_in_id = "IR";
70:
71: if (defined_in instanceof ContainedOperations)
72: defined_in_id = ((ContainedOperations) defined_in).id();
73:
74: TypeDescription td = new TypeDescription(name, id,
75: defined_in_id, version, typeCode);
76:
77: Any any = getORB().create_any();
78:
79: TypeDescriptionHelper.insert(any, td);
80:
81: return new Description(DefinitionKind.dk_Typedef, any);
82: }
83:
84: // IDLTypeOperations implementation -------------------------------
85:
86: public TypeCode type() {
87: return typeCode;
88: }
89:
90: // Package protected ---------------------------------------------
91:
92: // Private -------------------------------------------------------
93:
94: /**
95: * My TypeCode.
96: */
97: private TypeCode typeCode;
98: }
|