use of co.paralleluniverse.actors.Actor in project quasar by puniverse.
the class GlxMigrator method hire.
@Override
public Actor hire(ActorRef actorRef, ActorImpl impl, ByteArraySerializer ser) throws SuspendExecution {
final GlxGlobalChannelId gcid = ((GlxRemoteActor) impl).getId();
if (!gcid.isGlobal())
throw new IllegalArgumentException("Actor " + actorRef + " is not a migrating actor");
final long id = gcid.getAddress();
try {
store.setListener(id, null);
final byte[] buf = store.getx(id, null);
assert buf != null : actorRef + " " + impl;
final Object obj = ser.read(buf);
final Actor actor;
if (obj instanceof Actor)
actor = (Actor) obj;
else
throw new IllegalArgumentException("Serialized object " + obj + " is not an actor.");
GlobalRemoteChannelReceiver.getReceiver(actor.getMailbox(), id);
return actor;
} catch (co.paralleluniverse.galaxy.TimeoutException e) {
throw new RuntimeException(e);
}
}
Aggregations