Fri, 24 Sep 2010 22:42:14 -0700
6891766: Vulnerabilities in use of reflection in CORBA
Reviewed-by: hawtin
1 /*
2 * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
26 package org.omg.CORBA;
28 /**
29 * An object containing a modifiable list of <code>String</code> objects
30 * that represent property names.
31 * This class is used in <code>Request</code> operations to
32 * describe the contexts that need to be resolved and sent with the
33 * invocation. (A context is resolved by giving a property name
34 * and getting back the value associated with it.) This is done
35 * by calling the <code>Context</code> method
36 * <code>get_values</code> and supplying a string from a
37 * <code>ContextList</code> object as the third parameter.
38 * The method <code>get_values</code> returns an <code>NVList</code>
39 * object containing the <code>NamedValue</code> objects that hold
40 * the value(s) identified by the given string.
41 * <P>
42 * A <code>ContextList</code> object is created by the ORB, as
43 * illustrated here:
44 * <PRE>
45 * ORB orb = ORB.init(args, null);
46 * org.omg.CORBA.ContextList ctxList = orb.create_context_list();
47 * </PRE>
48 * The variable <code>ctxList</code> represents an empty
49 * <code>ContextList</code> object. Strings are added to
50 * the list with the method <code>add</code>, accessed
51 * with the method <code>item</code>, and removed with the
52 * method <code>remove</code>.
53 *
54 * @see Context
55 * @since JDK1.2
56 */
58 public abstract class ContextList {
60 /**
61 * Returns the number of <code>String</code> objects in this
62 * <code>ContextList</code> object.
63 *
64 * @return an <code>int</code> representing the number of
65 * <code>String</code>s in this <code>ContextList</code> object
66 */
68 public abstract int count();
70 /**
71 * Adds a <code>String</code> object to this <code>ContextList</code>
72 * object.
73 *
74 * @param ctx the <code>String</code> object to be added
75 */
77 public abstract void add(String ctx);
79 /**
80 * Returns the <code>String</code> object at the given index.
81 *
82 * @param index the index of the string desired, with 0 being the
83 index of the first string
84 * @return the string at the given index
85 * @exception org.omg.CORBA.Bounds if the index is greater than
86 * or equal to the number of strings in this
87 * <code>ContextList</code> object
88 */
90 public abstract String item(int index) throws org.omg.CORBA.Bounds;
92 /**
93 * Removes the <code>String</code> object at the given index. Note that
94 * the indices of all strings following the one removed are
95 * shifted down by one.
96 *
97 * @param index the index of the <code>String</code> object to be removed,
98 * with 0 designating the first string
99 * @exception org.omg.CORBA.Bounds if the index is greater than
100 * or equal to the number of <code>String</code> objects in
101 * this <code>ContextList</code> object
102 */
104 public abstract void remove(int index) throws org.omg.CORBA.Bounds;
106 }