Path: blob/master/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl_Skel.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*/242526package sun.rmi.registry;2728import java.io.IOException;29import java.io.ObjectInputStream;3031import jdk.internal.access.SharedSecrets;32import sun.rmi.transport.StreamRemoteCall;3334/**35* Skeleton to dispatch RegistryImpl methods.36* Originally generated by RMIC but frozen to match the stubs.37*/38@SuppressWarnings({"deprecation", "serial"})39public final class RegistryImpl_Skel40implements java.rmi.server.Skeleton {41private static final java.rmi.server.Operation[] operations = {42new java.rmi.server.Operation("void bind(java.lang.String, java.rmi.Remote)"),43new java.rmi.server.Operation("java.lang.String list()[]"),44new java.rmi.server.Operation("java.rmi.Remote lookup(java.lang.String)"),45new java.rmi.server.Operation("void rebind(java.lang.String, java.rmi.Remote)"),46new java.rmi.server.Operation("void unbind(java.lang.String)")47};4849private static final long interfaceHash = 4905912898345647071L;5051public java.rmi.server.Operation[] getOperations() {52return operations.clone();53}5455public void dispatch(java.rmi.Remote obj, java.rmi.server.RemoteCall remoteCall, int opnum, long hash)56throws java.lang.Exception {57if (opnum < 0) {58if (hash == 7583982177005850366L) {59opnum = 0;60} else if (hash == 2571371476350237748L) {61opnum = 1;62} else if (hash == -7538657168040752697L) {63opnum = 2;64} else if (hash == -8381844669958460146L) {65opnum = 3;66} else if (hash == 7305022919901907578L) {67opnum = 4;68} else {69throw new java.rmi.UnmarshalException("invalid method hash");70}71} else {72if (hash != interfaceHash)73throw new java.rmi.server.SkeletonMismatchException("interface hash mismatch");74}7576sun.rmi.registry.RegistryImpl server = (sun.rmi.registry.RegistryImpl) obj;77StreamRemoteCall call = (StreamRemoteCall) remoteCall;78switch (opnum) {79case 0: // bind(String, Remote)80{81// Check access before reading the arguments82RegistryImpl.checkAccess("Registry.bind");8384java.lang.String $param_String_1;85java.rmi.Remote $param_Remote_2;86try {87ObjectInputStream in = (ObjectInputStream)call.getInputStream();88$param_String_1 =89SharedSecrets.getJavaObjectInputStreamReadString().readString(in);90$param_Remote_2 = (java.rmi.Remote) in.readObject();91} catch (ClassCastException | IOException | ClassNotFoundException e) {92call.discardPendingRefs();93throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);94} finally {95call.releaseInputStream();96}97server.bind($param_String_1, $param_Remote_2);98try {99call.getResultStream(true);100} catch (java.io.IOException e) {101throw new java.rmi.MarshalException("error marshalling return", e);102}103break;104}105106case 1: // list()107{108call.releaseInputStream();109java.lang.String[] $result = server.list();110try {111java.io.ObjectOutput out = call.getResultStream(true);112out.writeObject($result);113} catch (java.io.IOException e) {114throw new java.rmi.MarshalException("error marshalling return", e);115}116break;117}118119case 2: // lookup(String)120{121java.lang.String $param_String_1;122try {123ObjectInputStream in = (ObjectInputStream)call.getInputStream();124$param_String_1 =125SharedSecrets.getJavaObjectInputStreamReadString().readString(in);126} catch (ClassCastException | IOException e) {127call.discardPendingRefs();128throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);129} finally {130call.releaseInputStream();131}132java.rmi.Remote $result = server.lookup($param_String_1);133try {134java.io.ObjectOutput out = call.getResultStream(true);135out.writeObject($result);136} catch (java.io.IOException e) {137throw new java.rmi.MarshalException("error marshalling return", e);138}139break;140}141142case 3: // rebind(String, Remote)143{144// Check access before reading the arguments145RegistryImpl.checkAccess("Registry.rebind");146147java.lang.String $param_String_1;148java.rmi.Remote $param_Remote_2;149try {150ObjectInputStream in = (ObjectInputStream)call.getInputStream();151$param_String_1 =152SharedSecrets.getJavaObjectInputStreamReadString().readString(in);153$param_Remote_2 = (java.rmi.Remote) in.readObject();154} catch (ClassCastException | IOException | java.lang.ClassNotFoundException e) {155call.discardPendingRefs();156throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);157} finally {158call.releaseInputStream();159}160server.rebind($param_String_1, $param_Remote_2);161try {162call.getResultStream(true);163} catch (java.io.IOException e) {164throw new java.rmi.MarshalException("error marshalling return", e);165}166break;167}168169case 4: // unbind(String)170{171// Check access before reading the arguments172RegistryImpl.checkAccess("Registry.unbind");173174java.lang.String $param_String_1;175try {176ObjectInputStream in = (ObjectInputStream)call.getInputStream();177$param_String_1 =178SharedSecrets.getJavaObjectInputStreamReadString().readString(in);179} catch (ClassCastException | IOException e) {180call.discardPendingRefs();181throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);182} finally {183call.releaseInputStream();184}185server.unbind($param_String_1);186try {187call.getResultStream(true);188} catch (java.io.IOException e) {189throw new java.rmi.MarshalException("error marshalling return", e);190}191break;192}193194default:195throw new java.rmi.UnmarshalException("invalid method number");196}197}198}199200201