public RemoteActor(String name, int stage_id) { super(false); this.name = name; this.host = TransportService.getHost(); this.port = TransportService.getPort(); int hashCode = hashCode(); this.stage = StageService.getStage(stage_id); this.stage_id = stage_id; Object lock = RemoteActorRegistry.getLock(hashCode); synchronized (lock) { RemoteActorRegistry.addEntry(hashCode, this); } // System.err.println("Created a remote actor at local theater with host: " + host + " // and port: " + port + ", and hashcode: " + hashCode); }
/** Attach to a target VM using the specified address and Connector arguments. */ public VirtualMachine attach(String address, Map args) throws IOException, IllegalConnectorArgumentsException { String ts = argument(ARG_TIMEOUT, args).value(); int timeout = 0; if (ts.length() > 0) { timeout = Integer.decode(ts).intValue(); } Connection connection = transportService.attach(address, timeout, 0); return Bootstrap.virtualMachineManager().createVirtualMachine(connection); }
public RemoteActor(String name, String host, int port) { super(false); this.name = name; if (host.equals("127.0.0.1") || host.equals("localhost")) { host = TransportService.getHost(); } this.host = host; this.port = port; int hashCode = hashCode(); this.stage = StageService.stages[Math.abs(hashCode % StageService.number_stages)]; this.stage_id = stage.getStageId(); // System.err.println("Created a remote actor at with pre-specified host: " + host + " // and port: " + port); }
public String description() { return transportService.description(); }