1 /* 2 * Copyright (c) 1999, 2001, 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 */ 25 /* 26 * Licensed Materials - Property of IBM 27 * RMI-IIOP v1.0 28 * Copyright IBM Corp. 1998 1999 All Rights Reserved 29 * 30 */ 31 32 package javax.rmi.CORBA; 33 34 import java.io.IOException; 35 import java.io.ObjectInputStream; 36 import java.io.ObjectOutputStream; 37 import java.rmi.RemoteException; 38 import org.omg.CORBA.ORB; 39 40 /** 41 * Supports delegation for method implementations in {@link Stub}. 42 * A delegate is an instance of a class that implements this 43 * interface and provides a replacement implementation for all the 44 * methods of <code>javax.rmi.CORBA.Stub</code>. If delegation is 45 * enabled, each stub has an associated delegate. 46 * 47 * Delegates are enabled by providing the delegate's class name as the 48 * value of the 49 * <code>javax.rmi.CORBA.StubClass</code> 50 * system property. 51 * 52 * @see Stub 53 * @since 1.3 54 */ 55 public interface StubDelegate { 56 57 /** 58 * Delegation call for {@link Stub#hashCode}. 59 */ 60 int hashCode(Stub self); 61 62 /** 63 * Delegation call for {@link Stub#equals}. 64 */ 65 boolean equals(Stub self, java.lang.Object obj); 66 67 /** 68 * Delegation call for {@link Stub#toString}. 69 */ 70 String toString(Stub self); 71 72 /** 73 * Delegation call for {@link Stub#connect}. 74 */ 75 void connect(Stub self, ORB orb) 76 throws RemoteException; 77 78 // _REVISIT_ cannot link to Stub.readObject directly... why not? 79 /** 80 * Delegation call for 81 * <a href="{@docRoot}/serialized-form.html#javax.rmi.CORBA.Stub"><code>Stub.readObject(java.io.ObjectInputStream)</code></a>. 82 */ 83 void readObject(Stub self, ObjectInputStream s) 84 throws IOException, ClassNotFoundException; 85 86 // _REVISIT_ cannot link to Stub.writeObject directly... why not? 87 /** 88 * Delegation call for 89 * <a href="{@docRoot}/serialized-form.html#javax.rmi.CORBA.Stub"><code>Stub.writeObject(java.io.ObjectOutputStream)</code></a>. 90 */ 91 void writeObject(Stub self, ObjectOutputStream s) 92 throws IOException; 93 94 }