1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/classes/org/omg/CORBA/ExceptionList.java Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,110 @@ 1.4 +/* 1.5 + * Copyright 1996-1999 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. Sun designates this 1.11 + * particular file as subject to the "Classpath" exception as provided 1.12 + * by Sun in the LICENSE file that accompanied this code. 1.13 + * 1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 + * version 2 for more details (a copy is included in the LICENSE file that 1.18 + * accompanied this code). 1.19 + * 1.20 + * You should have received a copy of the GNU General Public License version 1.21 + * 2 along with this work; if not, write to the Free Software Foundation, 1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 + * 1.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.25 + * CA 95054 USA or visit www.sun.com if you need additional information or 1.26 + * have any questions. 1.27 + */ 1.28 + 1.29 +package org.omg.CORBA; 1.30 + 1.31 +/** 1.32 + * An object used in <code>Request</code> operations to 1.33 + * describe the exceptions that can be thrown by a method. It maintains a 1.34 + * modifiable list of <code>TypeCode</code>s of the exceptions. 1.35 + * <P> 1.36 + * The following code fragment demonstrates creating 1.37 + * an <code>ExceptionList</code> object: 1.38 + * <PRE> 1.39 + * ORB orb = ORB.init(args, null); 1.40 + * org.omg.CORBA.ExceptionList excList = orb.create_exception_list(); 1.41 + * </PRE> 1.42 + * The variable <code>excList</code> represents an <code>ExceptionList</code> 1.43 + * object with no <code>TypeCode</code> objects in it. 1.44 + * <P> 1.45 + * To add items to the list, you first create a <code>TypeCode</code> object 1.46 + * for the exception you want to include, using the <code>ORB</code> method 1.47 + * <code>create_exception_tc</code>. Then you use the <code>ExceptionList</code> 1.48 + * method <code>add</code> to add it to the list. 1.49 + * The class <code>ExceptionList</code> has a method for getting 1.50 + * the number of <code>TypeCode</code> objects in the list, and after 1.51 + * items have been added, it is possible to call methods for accessing 1.52 + * or deleting an item at a designated index. 1.53 + * 1.54 + * @since JDK1.2 1.55 + */ 1.56 + 1.57 +public abstract class ExceptionList { 1.58 + 1.59 + /** 1.60 + * Retrieves the number of <code>TypeCode</code> objects in this 1.61 + * <code>ExceptionList</code> object. 1.62 + * 1.63 + * @return the number of <code>TypeCode</code> objects in this 1.64 + * <code>ExceptionList</code> object 1.65 + */ 1.66 + 1.67 + public abstract int count(); 1.68 + 1.69 + /** 1.70 + * Adds a <code>TypeCode</code> object describing an exception 1.71 + * to this <code>ExceptionList</code> object. 1.72 + * 1.73 + * @param exc the <code>TypeCode</code> object to be added 1.74 + */ 1.75 + 1.76 + public abstract void add(TypeCode exc); 1.77 + 1.78 + /** 1.79 + * Returns the <code>TypeCode</code> object at the given index. The first 1.80 + * item is at index 0. 1.81 + * 1.82 + * @param index the index of the <code>TypeCode</code> object desired. 1.83 + * This must be an <code>int</code> between 0 and the 1.84 + * number of <code>TypeCode</code> objects 1.85 + * minus one, inclusive. 1.86 + * @return the <code>TypeCode</code> object at the given index 1.87 + * @exception org.omg.CORBA.Bounds if the index given is greater than 1.88 + * or equal to the number of <code>TypeCode</code> objects 1.89 + * in this <code>ExceptionList</code> object 1.90 + */ 1.91 + 1.92 + public abstract TypeCode item(int index) 1.93 + throws org.omg.CORBA.Bounds; 1.94 + 1.95 + /** 1.96 + * Removes the <code>TypeCode</code> object at the given index. 1.97 + * Note that the indices of all the <code>TypeCoded</code> objects 1.98 + * following the one deleted are shifted down by one. 1.99 + * 1.100 + * @param index the index of the <code>TypeCode</code> object to be 1.101 + * removed. 1.102 + * This must be an <code>int</code> between 0 and the 1.103 + * number of <code>TypeCode</code> objects 1.104 + * minus one, inclusive. 1.105 + * 1.106 + * @exception org.omg.CORBA.Bounds if the index is greater than 1.107 + * or equal to the number of <code>TypeCode</code> objects 1.108 + * in this <code>ExceptionList</code> object 1.109 + */ 1.110 + 1.111 + public abstract void remove(int index) 1.112 + throws org.omg.CORBA.Bounds; 1.113 +}