/* * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ import java.rmi.Remote; import javax.rmi.CORBA.Tie; import javax.rmi.CORBA.Util; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; import org.omg.CORBA.SystemException; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; import org.omg.CORBA.portable.ResponseHandler; import org.omg.CORBA.portable.UnknownException; import org.omg.CORBA_2_3.portable.ObjectImpl; /** * ObjectStreamClass$Echo server tie class generated by rmic, do not edit. */ public class ObjectStreamTest$_Server_Tie extends ObjectImpl implements Tie { volatile private ObjectStreamTest.Server target = null; private static final String[] _type_ids = { "RMI:ObjectStreamTest\\U0024Echo:0000000000000000" }; public void setTarget(Remote target) { this.target = (ObjectStreamTest.Server) target; } public Remote getTarget() { return target; } public org.omg.CORBA.Object thisObject() { return this; } public void deactivate() { _orb().disconnect(this); _set_delegate(null); target = null; } public ORB orb() { return _orb(); } public void orb(ORB orb) { orb.connect(this); } public String[] _ids() { return _type_ids.clone(); } public OutputStream _invoke(String method, InputStream _in, ResponseHandler reply) throws SystemException { try { ObjectStreamTest.Server target = this.target; if (target == null) { throw new java.io.IOException(); } org.omg.CORBA_2_3.portable.InputStream in = (org.omg.CORBA_2_3.portable.InputStream) _in; if (method.equals("echo")) { Object arg0 = Util.readAny(in); Object result = target.echo(arg0); OutputStream out = reply.createReply(); Util.writeAny(out,result); return out; } throw new BAD_OPERATION(); } catch (SystemException ex) { throw ex; } catch (Throwable ex) { throw new UnknownException(ex); } } }