/** * @see co.vaughnvernon.actormodel.actor.Actor#self() */ @Override public ActorAgent self() { return this.registry().actorAgentFor(this); }
public LocalMailboxFutureActor( ActorInitializer anInitializer) { super(anInitializer); this.future = anInitializer.getParameter("future"); }
/** * @see co.vaughnvernon.actormodel.actor.Actor#sender() */ @Override public ActorAgent sender() { return NullActorAgent.instance(); }
public void testProductPlanBacklogItem() throws Exception { ActorInitializer initializer = new ActorInitializer(this.actorRegistry); initializer.putParameter("name", "Test Product"); initializer.putParameter("description", "A decsription."); ActorAgent product = this.actorRegistry.actorFor(Product.class, initializer); product.tell(new PlanBacklogItem( "A summary of the backlog item.", "A story about the backlog item.")); this.stayAlive(); this.actorRegistry.expectedMessages(2); this.actorRegistry.expectedMessage(PlanBacklogItem.class); this.actorRegistry.expectedMessage(BacklogItemPlanned.class); }
public BacklogItem(ActorInitializer anInitializer) { super(anInitializer.address(), anInitializer.registry()); this.story = anInitializer.getParameter("story"); this.summary = anInitializer.getParameter("summary"); ActorAgent product = anInitializer.getParameter("product"); this.product = product.address(); product.tell(new BacklogItemPlanned(product.address(), this.self().address())); }
public Product(ActorInitializer anInitializer) { super(anInitializer.address(), anInitializer.registry()); this.description = anInitializer.getParameter("description"); this.name = anInitializer.getParameter("name"); }
public void when(PlanBacklogItem aCommand) { ActorInitializer initializer = new ActorInitializer(this.registry()); initializer.putParameter("product", this.self()); initializer.putParameter("summary", aCommand.summary()); initializer.putParameter("story", aCommand.story()); this.registry().actorFor(BacklogItem.class, initializer); }
public void testCreateNullActorAgent() throws Exception { ActorAgent agent = NullActorAgent.instance(); assertNotNull(agent); }
/** * @see java.lang.Object#toString() */ @Override public String toString() { return "Address=" + this.address(); }
/** * @see co.vaughnvernon.actormodel.actor.ActorRegistry#newActorInitializer() */ @Override public ActorInitializer newActorInitializer() { return new ActorInitializer(this); }
@Override protected void setUp() throws Exception { assertNotNull(this.actorRegistry); this.actorRegistry.expectedMessages(0); super.setUp(); }
/** * Answers a new, immutable, Address using anAddress. * @param anAddress the String address of the actor * @return Address */ public static Address instanceFrom(String anAddress) { return new Address(anAddress); }
/** * Constructs my default state with anId. * @param anAddress the String id to set as my id */ private Address(String anAddress) { super(); this.setAddress(anAddress); }
public Query(String aName, Object aValue) { this(); this.putParameter(aName, aValue); }
@Override public Address address() { return this.actor.address(); }
protected void stayAlive() { this.stayAlive(300L); }
/** * Constructs my default state. */ private NullFuture() { super(); this.nullActorAgent = NullActorAgent.instance(); } }
@Override public String toString() { return "BacklogItem [summary=" + summary + ", story=" + story + ", sprint=" + (sprint == null ? "not committed" : sprint.address()) +"]"; } }
/** * Answers a new, immutable, unique Address. * @return Address */ public static Address newNullInstance() { return new Address(null); }