Path: blob/master/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl_Stub.java
41154 views
/*1* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.rmi.registry;2627import java.io.IOException;2829import sun.rmi.transport.StreamRemoteCall;3031/**32* Stubs to invoke RegistryImpl remote methods.33* Originally generated from RMIC but frozen to match RegistryImpl_Skel.34*/35@SuppressWarnings({"deprecation", "serial"})36public final class RegistryImpl_Stub37extends java.rmi.server.RemoteStub38implements java.rmi.registry.Registry, java.rmi.Remote {39private static final java.rmi.server.Operation[] operations = {40new java.rmi.server.Operation("void bind(java.lang.String, java.rmi.Remote)"),41new java.rmi.server.Operation("java.lang.String list()[]"),42new java.rmi.server.Operation("java.rmi.Remote lookup(java.lang.String)"),43new java.rmi.server.Operation("void rebind(java.lang.String, java.rmi.Remote)"),44new java.rmi.server.Operation("void unbind(java.lang.String)")45};4647private static final long interfaceHash = 4905912898345647071L;4849// constructors50public RegistryImpl_Stub() {51super();52}5354public RegistryImpl_Stub(java.rmi.server.RemoteRef ref) {55super(ref);56}5758// methods from remote interfaces5960// implementation of bind(String, Remote)61public void bind(java.lang.String $param_String_1, java.rmi.Remote $param_Remote_2)62throws java.rmi.AccessException, java.rmi.AlreadyBoundException, java.rmi.RemoteException {63try {64StreamRemoteCall call = (StreamRemoteCall)ref.newCall(this, operations, 0, interfaceHash);65try {66java.io.ObjectOutput out = call.getOutputStream();67out.writeObject($param_String_1);68out.writeObject($param_Remote_2);69} catch (java.io.IOException e) {70throw new java.rmi.MarshalException("error marshalling arguments", e);71}72ref.invoke(call);73ref.done(call);74} catch (java.lang.RuntimeException e) {75throw e;76} catch (java.rmi.RemoteException e) {77throw e;78} catch (java.rmi.AlreadyBoundException e) {79throw e;80} catch (java.lang.Exception e) {81throw new java.rmi.UnexpectedException("undeclared checked exception", e);82}83}8485// implementation of list()86public java.lang.String[] list()87throws java.rmi.AccessException, java.rmi.RemoteException {88try {89StreamRemoteCall call = (StreamRemoteCall)ref.newCall(this, operations, 1, interfaceHash);90ref.invoke(call);91java.lang.String[] $result;92try {93java.io.ObjectInput in = call.getInputStream();94$result = (java.lang.String[]) in.readObject();95} catch (ClassCastException | IOException | ClassNotFoundException e) {96call.discardPendingRefs();97throw new java.rmi.UnmarshalException("error unmarshalling return", e);98} finally {99ref.done(call);100}101return $result;102} catch (java.lang.RuntimeException e) {103throw e;104} catch (java.rmi.RemoteException e) {105throw e;106} catch (java.lang.Exception e) {107throw new java.rmi.UnexpectedException("undeclared checked exception", e);108}109}110111// implementation of lookup(String)112public java.rmi.Remote lookup(java.lang.String $param_String_1)113throws java.rmi.AccessException, java.rmi.NotBoundException, java.rmi.RemoteException {114try {115StreamRemoteCall call = (StreamRemoteCall)ref.newCall(this, operations, 2, interfaceHash);116try {117java.io.ObjectOutput out = call.getOutputStream();118out.writeObject($param_String_1);119} catch (java.io.IOException e) {120throw new java.rmi.MarshalException("error marshalling arguments", e);121}122ref.invoke(call);123java.rmi.Remote $result;124try {125java.io.ObjectInput in = call.getInputStream();126$result = (java.rmi.Remote) in.readObject();127} catch (ClassCastException | IOException | ClassNotFoundException e) {128call.discardPendingRefs();129throw new java.rmi.UnmarshalException("error unmarshalling return", e);130} finally {131ref.done(call);132}133return $result;134} catch (java.lang.RuntimeException e) {135throw e;136} catch (java.rmi.RemoteException e) {137throw e;138} catch (java.rmi.NotBoundException e) {139throw e;140} catch (java.lang.Exception e) {141throw new java.rmi.UnexpectedException("undeclared checked exception", e);142}143}144145// implementation of rebind(String, Remote)146public void rebind(java.lang.String $param_String_1, java.rmi.Remote $param_Remote_2)147throws java.rmi.AccessException, java.rmi.RemoteException {148try {149StreamRemoteCall call = (StreamRemoteCall)ref.newCall(this, operations, 3, interfaceHash);150try {151java.io.ObjectOutput out = call.getOutputStream();152out.writeObject($param_String_1);153out.writeObject($param_Remote_2);154} catch (java.io.IOException e) {155throw new java.rmi.MarshalException("error marshalling arguments", e);156}157ref.invoke(call);158ref.done(call);159} catch (java.lang.RuntimeException e) {160throw e;161} catch (java.rmi.RemoteException e) {162throw e;163} catch (java.lang.Exception e) {164throw new java.rmi.UnexpectedException("undeclared checked exception", e);165}166}167168// implementation of unbind(String)169public void unbind(java.lang.String $param_String_1)170throws java.rmi.AccessException, java.rmi.NotBoundException, java.rmi.RemoteException {171try {172StreamRemoteCall call = (StreamRemoteCall)ref.newCall(this, operations, 4, interfaceHash);173try {174java.io.ObjectOutput out = call.getOutputStream();175out.writeObject($param_String_1);176} catch (java.io.IOException e) {177throw new java.rmi.MarshalException("error marshalling arguments", e);178}179ref.invoke(call);180ref.done(call);181} catch (java.lang.RuntimeException e) {182throw e;183} catch (java.rmi.RemoteException e) {184throw e;185} catch (java.rmi.NotBoundException e) {186throw e;187} catch (java.lang.Exception e) {188throw new java.rmi.UnexpectedException("undeclared checked exception", e);189}190}191}192193194