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.spi.ior;
27:
28: import java.util.List;
29: import java.util.Iterator;
30:
31: import org.omg.CORBA_2_3.portable.OutputStream;
32:
33: import com.sun.corba.se.spi.ior.Identifiable;
34: import com.sun.corba.se.spi.ior.Writeable;
35: import com.sun.corba.se.spi.ior.ObjectId;
36: import com.sun.corba.se.spi.ior.WriteContents;
37:
38: import com.sun.corba.se.spi.orb.ORB;
39:
40: /** Base template for creating TaggedProfiles. A TaggedProfile will often contain
41: * tagged components. A template that does not contain components acts like
42: * an empty immutable list.
43: *
44: * @author Ken Cavanaugh
45: */
46: public interface TaggedProfileTemplate extends List, Identifiable,
47: WriteContents, MakeImmutable {
48: /** Return an iterator that iterates over tagged components with
49: * identifier id. It is not possible to modify the list through this
50: * iterator.
51: */
52: public Iterator iteratorById(int id);
53:
54: /** Create a TaggedProfile from this template.
55: */
56: TaggedProfile create(ObjectKeyTemplate oktemp, ObjectId id);
57:
58: /** Write the profile create( oktemp, id ) to the OutputStream os.
59: */
60: void write(ObjectKeyTemplate oktemp, ObjectId id, OutputStream os);
61:
62: /** Return true if temp is equivalent to this template. Equivalence
63: * means that in some sense an invocation on a profile created by this
64: * template has the same results as an invocation on a profile
65: * created from temp. Equivalence may be weaker than equality.
66: */
67: boolean isEquivalent(TaggedProfileTemplate temp);
68:
69: /** Return the tagged components in this profile (if any)
70: * in the GIOP marshalled form, which is required for Portable
71: * Interceptors. Returns null if either the profile has no
72: * components, or if this type of profile can never contain
73: * components.
74: */
75: org.omg.IOP.TaggedComponent[] getIOPComponents(ORB orb, int id);
76: }
|