001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.iiop.rmi.ir;
023:
024: import org.omg.CORBA.ContainerOperations;
025: import org.omg.CORBA.Contained;
026: import org.omg.CORBA.Container;
027: import org.omg.CORBA.ContainerPackage.Description;
028: import org.omg.CORBA.ContainerHelper;
029: import org.omg.CORBA.IDLType;
030: import org.omg.CORBA.DefinitionKind;
031: import org.omg.CORBA.StructMember;
032: import org.omg.CORBA.UnionMember;
033: import org.omg.CORBA.InterfaceDef;
034: import org.omg.CORBA.ConstantDef;
035: import org.omg.CORBA.EnumDef;
036: import org.omg.CORBA.ValueDef;
037: import org.omg.CORBA.ValueBoxDef;
038: import org.omg.CORBA.Initializer;
039: import org.omg.CORBA.StructDef;
040: import org.omg.CORBA.UnionDef;
041: import org.omg.CORBA.ModuleDef;
042: import org.omg.CORBA.NativeDef;
043: import org.omg.CORBA.AliasDef;
044: import org.omg.CORBA.Any;
045: import org.omg.CORBA.ExceptionDef;
046:
047: import java.util.Map;
048:
049: import java.util.HashMap;
050:
051: /**
052: * Abstract base class for container IR entities.
053: *
054: * @author <a href="mailto:osh@sparre.dk">Ole Husgaard</a>
055: * @version $Revision: 57194 $
056: */
057: abstract class ContainerImpl extends IRObjectImpl implements
058: ContainerOperations, LocalContainer {
059: // Constants -----------------------------------------------------
060:
061: // Attributes ----------------------------------------------------
062:
063: // Static --------------------------------------------------------
064:
065: // Constructors --------------------------------------------------
066:
067: ContainerImpl(DefinitionKind def_kind, RepositoryImpl repository) {
068: super (def_kind, repository);
069:
070: this .delegate = new ContainerImplDelegate(this );
071: }
072:
073: // Public --------------------------------------------------------
074:
075: // LocalContainer implementation ---------------------------------
076:
077: public LocalContained _lookup(String search_name) {
078: return delegate._lookup(search_name);
079: }
080:
081: public LocalContained[] _contents(DefinitionKind limit_type,
082: boolean exclude_inherited) {
083: return delegate._contents(limit_type, exclude_inherited);
084: }
085:
086: public LocalContained[] _lookup_name(String search_name,
087: int levels_to_search, DefinitionKind limit_type,
088: boolean exclude_inherited) {
089: return delegate._lookup_name(search_name, levels_to_search,
090: limit_type, exclude_inherited);
091: }
092:
093: public void add(String name, LocalContained contained)
094: throws IRConstructionException {
095: delegate.add(name, contained);
096: }
097:
098: public void allDone() throws IRConstructionException {
099: getReference();
100: delegate.allDone();
101: }
102:
103: public void shutdown() {
104: delegate.shutdown();
105: super .shutdown();
106: }
107:
108: // ContainerOperations implementation ----------------------------
109:
110: public Contained lookup(String search_name) {
111: return delegate.lookup(search_name);
112: }
113:
114: public Contained[] contents(DefinitionKind limit_type,
115: boolean exclude_inherited) {
116: return delegate.contents(limit_type, exclude_inherited);
117: }
118:
119: public Contained[] lookup_name(String search_name,
120: int levels_to_search, DefinitionKind limit_type,
121: boolean exclude_inherited) {
122: return delegate.lookup_name(search_name, levels_to_search,
123: limit_type, exclude_inherited);
124: }
125:
126: public Description[] describe_contents(DefinitionKind limit_type,
127: boolean exclude_inherited, int max_returned_objs) {
128: return delegate.describe_contents(limit_type,
129: exclude_inherited, max_returned_objs);
130: }
131:
132: public ModuleDef create_module(String id, String name,
133: String version) {
134: return delegate.create_module(id, name, version);
135: }
136:
137: public ConstantDef create_constant(String id, String name,
138: String version, IDLType type, Any value) {
139: return delegate.create_constant(id, name, version, type, value);
140: }
141:
142: public StructDef create_struct(String id, String name,
143: String version, StructMember[] members) {
144: return delegate.create_struct(id, name, version, members);
145: }
146:
147: public UnionDef create_union(String id, String name,
148: String version, IDLType discriminator_type,
149: UnionMember[] members) {
150: return delegate.create_union(id, name, version,
151: discriminator_type, members);
152: }
153:
154: public EnumDef create_enum(String id, String name, String version,
155: String[] members) {
156: return delegate.create_enum(id, name, version, members);
157: }
158:
159: public AliasDef create_alias(String id, String name,
160: String version, IDLType original_type) {
161: return delegate.create_alias(id, name, version, original_type);
162: }
163:
164: public InterfaceDef create_interface(String id, String name,
165: String version, InterfaceDef[] base_interfaces,
166: boolean is_abstract) {
167: return delegate.create_interface(id, name, version,
168: base_interfaces, is_abstract);
169: }
170:
171: public ValueDef create_value(String id, String name,
172: String version, boolean is_custom, boolean is_abstract,
173: ValueDef base_value, boolean is_truncatable,
174: ValueDef[] abstract_base_values,
175: InterfaceDef[] supported_interfaces,
176: Initializer[] initializers) {
177: return delegate.create_value(id, name, version, is_custom,
178: is_abstract, base_value, is_truncatable,
179: abstract_base_values, supported_interfaces,
180: initializers);
181: }
182:
183: public ValueBoxDef create_value_box(String id, String name,
184: String version, IDLType original_type_def) {
185: return delegate.create_value_box(id, name, version,
186: original_type_def);
187: }
188:
189: public ExceptionDef create_exception(String id, String name,
190: String version, StructMember[] members) {
191: return delegate.create_exception(id, name, version, members);
192: }
193:
194: public NativeDef create_native(String id, String name,
195: String version) {
196: return delegate.create_native(id, name, version);
197: }
198:
199: // Y overrides ---------------------------------------------------
200:
201: // Package protected ---------------------------------------------
202:
203: // Protected -----------------------------------------------------
204:
205: // Private -------------------------------------------------------
206:
207: /**
208: * My delegate for Container functionality.
209: */
210: ContainerImplDelegate delegate;
211:
212: // Inner classes -------------------------------------------------
213: }
|