Doc: Corrected a few spelling mistakes (#1840)
This commit is contained in:
parent
87cc4df14b
commit
119abf3ee4
@ -11,7 +11,7 @@ tags:
|
||||
|
||||
|
||||
## Intent
|
||||
The active object design pattern decouples method execution from method invocation for objects that each reside in their thread of control. The goal is to introduce concurrency, by using asynchronous method invocation and a scheduler for handling requests.
|
||||
The active object design pattern decouples method execution from method invocation for objects that each reside in their thread of control. The goal is to introduce concurrency, by using asynchronous method invocation, and a scheduler for handling requests.
|
||||
|
||||
## Explanation
|
||||
|
||||
@ -70,7 +70,7 @@ public abstract class ActiveCreature{
|
||||
requests.put(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
logger.info("{} has started to roam and the wastelands.",name());
|
||||
logger.info("{} has started to roam the wastelands.",name());
|
||||
}
|
||||
}
|
||||
);
|
||||
@ -82,7 +82,7 @@ public abstract class ActiveCreature{
|
||||
}
|
||||
```
|
||||
|
||||
We can see that any class that will extend the ActiveCreature class will have its own thread of control to execute and invocate methods.
|
||||
We can see that any class that will extend the ActiveCreature class will have its own thread of control to invoke and execute methods.
|
||||
|
||||
For example, the Orc class:
|
||||
|
||||
@ -96,7 +96,7 @@ public class Orc extends ActiveCreature {
|
||||
}
|
||||
```
|
||||
|
||||
Now, we can create multiple creatures such as Orcs, tell them to eat and roam and they will execute it on their own thread of control:
|
||||
Now, we can create multiple creatures such as Orcs, tell them to eat and roam, and they will execute it on their own thread of control:
|
||||
|
||||
```java
|
||||
public static void main(String[] args) {
|
||||
|
@ -82,7 +82,7 @@ public abstract class ActiveCreature {
|
||||
}
|
||||
|
||||
/**
|
||||
* Roam in the wastelands.
|
||||
* Roam the wastelands.
|
||||
* @throws InterruptedException due to firing a new Runnable.
|
||||
*/
|
||||
public void roam() throws InterruptedException {
|
||||
|
Loading…
x
Reference in New Issue
Block a user