1/* 2 * Copyright (c) 1998, 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. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24// Stub class generated by rmic, do not edit. 25// Contents subject to change without notice. 26 27public final class UseCustomRef_Stub 28 extends java.rmi.server.RemoteStub 29 implements Ping, java.rmi.Remote 30{ 31 private static final java.rmi.server.Operation[] operations = { 32 new java.rmi.server.Operation("void ping()"), 33 new java.rmi.server.Operation("void receiveAndPing(Ping)") 34 }; 35 36 private static final long interfaceHash = 8457085322718440165L; 37 38 private static final long serialVersionUID = 2; 39 40 private static boolean useNewInvoke; 41 private static java.lang.reflect.Method $method_ping_0; 42 private static java.lang.reflect.Method $method_receiveAndPing_1; 43 44 static { 45 try { 46 java.rmi.server.RemoteRef.class.getMethod("invoke", 47 new java.lang.Class[] { 48 java.rmi.Remote.class, 49 java.lang.reflect.Method.class, 50 java.lang.Object[].class, 51 long.class 52 }); 53 useNewInvoke = true; 54 $method_ping_0 = Ping.class.getMethod("ping", new java.lang.Class[] {}); 55 $method_receiveAndPing_1 = Ping.class.getMethod("receiveAndPing", new java.lang.Class[] {Ping.class}); 56 } catch (java.lang.NoSuchMethodException e) { 57 useNewInvoke = false; 58 } 59 } 60 61 // constructors 62 public UseCustomRef_Stub() { 63 super(); 64 } 65 public UseCustomRef_Stub(java.rmi.server.RemoteRef ref) { 66 super(ref); 67 } 68 69 // methods from remote interfaces 70 71 // implementation of ping() 72 public void ping() 73 throws java.rmi.RemoteException 74 { 75 try { 76 if (useNewInvoke) { 77 ref.invoke(this, $method_ping_0, null, 5866401369815527589L); 78 } else { 79 java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 0, interfaceHash); 80 ref.invoke(call); 81 ref.done(call); 82 } 83 } catch (java.lang.RuntimeException e) { 84 throw e; 85 } catch (java.rmi.RemoteException e) { 86 throw e; 87 } catch (java.lang.Exception e) { 88 throw new java.rmi.UnexpectedException("undeclared checked exception", e); 89 } 90 } 91 92 // implementation of receiveAndPing(Ping) 93 public void receiveAndPing(Ping $param_Ping_1) 94 throws java.rmi.RemoteException 95 { 96 try { 97 if (useNewInvoke) { 98 ref.invoke(this, $method_receiveAndPing_1, new java.lang.Object[] {$param_Ping_1}, -5964458762870933304L); 99 } else { 100 java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 1, interfaceHash); 101 try { 102 java.io.ObjectOutput out = call.getOutputStream(); 103 out.writeObject($param_Ping_1); 104 } catch (java.io.IOException e) { 105 throw new java.rmi.MarshalException("error marshalling arguments", e); 106 } 107 ref.invoke(call); 108 ref.done(call); 109 } 110 } catch (java.lang.RuntimeException e) { 111 throw e; 112 } catch (java.rmi.RemoteException e) { 113 throw e; 114 } catch (java.lang.Exception e) { 115 throw new java.rmi.UnexpectedException("undeclared checked exception", e); 116 } 117 } 118} 119