1 package org.sapia.ubik.rmi.server; 2 3 import java.io.IOException ; 4 import java.io.ObjectInput ; 5 import java.io.ObjectOutput ; 6 7 8 18 public class CommandConnect extends RMICommand { 19 private String _transportType; 20 21 22 public CommandConnect() { 23 } 24 25 public CommandConnect(String transportType) { 26 _transportType = transportType; 27 } 28 29 32 public Object execute() throws Throwable { 33 ServerRef ref = Hub.serverRuntime.server.getServerRef(_transportType); 34 Hub.serverRuntime.gc.registerRef(_vmId, ref.oid, ref.server); 35 36 return ref.stub; 37 } 38 39 42 public void readExternal(ObjectInput in) 43 throws IOException , ClassNotFoundException { 44 super.readExternal(in); 45 _transportType = in.readUTF(); 46 } 47 48 51 public void writeExternal(ObjectOutput out) throws IOException { 52 super.writeExternal(out); 53 out.writeUTF(_transportType); 54 } 55 } 56 | Popular Tags |