// Tie class generated by rmic, do not edit. // Contents subject to change without notice. package examples.iiop; import com.healthmarketscience.rmiio.RemoteInputStream; import java.io.IOException; import java.io.Serializable; import java.rmi.Remote; import java.rmi.RemoteException; import javax.rmi.CORBA.Tie; import javax.rmi.CORBA.Util; import javax.rmi.PortableRemoteObject; 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.PortableServer.Servant; public class _TestServer_Tie extends Servant implements Tie { private TestServer target = null; private static final String[] _type_ids = { "RMI:examples.iiop.RemoteFileServer:0000000000000000" }; public void setTarget(Remote target) { this.target = (TestServer) target; } public Remote getTarget() { return target; } public org.omg.CORBA.Object thisObject() { return _this_object(); } public void deactivate() { try{ _poa().deactivate_object(_poa().servant_to_id(this)); }catch (org.omg.PortableServer.POAPackage.WrongPolicy exception){ }catch (org.omg.PortableServer.POAPackage.ObjectNotActive exception){ }catch (org.omg.PortableServer.POAPackage.ServantNotActive exception){ } } public ORB orb() { return _orb(); } public void orb(ORB orb) { try { ((org.omg.CORBA_2_3.ORB)orb).set_delegate(this); } catch(ClassCastException e) { throw new org.omg.CORBA.BAD_PARAM ("POA Servant requires an instance of org.omg.CORBA_2_3.ORB"); } } public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectId){ return _type_ids; } public OutputStream _invoke(String method, InputStream _in, ResponseHandler reply) throws SystemException { try { org.omg.CORBA_2_3.portable.InputStream in = (org.omg.CORBA_2_3.portable.InputStream) _in; if (method.equals("sendFile")) { RemoteInputStream arg0 = (RemoteInputStream) PortableRemoteObject.narrow(in.read_Object(), RemoteInputStream.class); try { target.sendFile(arg0); } catch (IOException ex) { String id = "IDL:java/io/IOEx:1.0"; org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createExceptionReply(); out.write_string(id); out.write_value(ex,IOException.class); return out; } OutputStream out = reply.createReply(); return out; } throw new BAD_OPERATION(); } catch (SystemException ex) { throw ex; } catch (Throwable ex) { throw new UnknownException(ex); } } }