Made Agent an abstract class, pushed existing implementation into a private SecretAgent class and added a java-lovin' factory method. See #3108

This commit is contained in:
Kevin Wright 2013-02-27 12:12:58 +00:00
parent 7884c6a71c
commit f305ed72a8
2 changed files with 91 additions and 52 deletions

View file

@ -35,7 +35,7 @@ public class AgentDocTest {
public void createAndRead() throws Exception {
//#create
ExecutionContext ec = ExecutionContexts.global();
Agent<Integer> agent = new Agent<Integer>(5, ec);
Agent<Integer> agent = Agent.create(5, ec);
//#create
//#read-get
@ -52,7 +52,7 @@ public class AgentDocTest {
@Test
public void sendAndSendOffAndReadAwait() throws Exception {
Agent<Integer> agent = new Agent<Integer>(5, ec);
Agent<Integer> agent = Agent.create(5, ec);
//#send
// send a value, enqueues this change
@ -86,7 +86,7 @@ public class AgentDocTest {
@Test
public void alterAndAlterOff() throws Exception {
Agent<Integer> agent = new Agent<Integer>(5, ec);
Agent<Integer> agent = Agent.create(5, ec);
//#alter
// alter a value