Skip to content

Commit

Permalink
initialized => active
Browse files Browse the repository at this point in the history
  • Loading branch information
laforge49 committed Apr 8, 2012
1 parent e2c9ae0 commit 32c05da
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
Expand Up @@ -37,7 +37,7 @@ abstract public class ConcurrentRequest<RESPONSE_TYPE, TARGET_TYPE extends Targe
*/
final public RESPONSE_TYPE call(TARGET_TYPE targetActor)
throws Exception {
targetActor.initialized();
targetActor.activate();
return _call(targetActor);
}
}
Expand Up @@ -25,7 +25,7 @@

/**
* A request that can be passed synchronously to a JBActor for processing,
* but only until the actor is initialized.
* but only until the actor is activate.
*/
abstract public class InitializationRequest<RESPONSE_TYPE, TARGET_TYPE extends TargetActor>
extends ExternallyCallableRequest<RESPONSE_TYPE, TARGET_TYPE> {
Expand All @@ -38,8 +38,8 @@ abstract public class InitializationRequest<RESPONSE_TYPE, TARGET_TYPE extends T
*/
final public RESPONSE_TYPE call(TARGET_TYPE targetActor)
throws Exception {
if (targetActor.isInitialized()) {
throw new IllegalStateException("already initialized");
if (targetActor.isActive()) {
throw new IllegalStateException("already activate");
}
return _call(targetActor);
}
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/org/agilewiki/jactor/lpc/JLPCActor.java
Expand Up @@ -63,7 +63,7 @@
*/
abstract public class JLPCActor implements TargetActor, RequestProcessor, RequestSource {
/**
* True when initialized.
* True when activate.
*/
private boolean initialized;

Expand Down Expand Up @@ -98,18 +98,18 @@ final public JLPCActor getParent() {
}

/**
* Returns true when initialized.
* Returns true when active.
*
* @return True when initialized.
* @return True when active.
*/
final public boolean isInitialized() {
final public boolean isActive() {
return initialized;
}

/**
* Marks the actor as initialized.
* Marks the actor as active.
*/
final public void initialized() {
final public void activate() {
initialized = true;
}

Expand Down Expand Up @@ -542,12 +542,12 @@ final public boolean hasDataItem(String name) {
*/
private void _processRequest(Object request, RP rp)
throws Exception {
if (isInitialized()) {
if (isActive()) {
if (request instanceof InitializationRequest) {
throw new IllegalStateException("already initialized");
throw new IllegalStateException("already activate");
}
} else if (!(request instanceof InitializationRequest)) {
initialized();
activate();
}
setExceptionHandler(null);
processRequest(request, rp);
Expand Down
Expand Up @@ -76,7 +76,7 @@ final public RESPONSE_TYPE call(Actor srcActor, TARGET_TYPE targetActor)
*/
final protected RESPONSE_TYPE call(TARGET_TYPE targetActor)
throws Exception {
targetActor.initialized();
targetActor.activate();
return _call(targetActor);
}
}
10 changes: 5 additions & 5 deletions src/main/java/org/agilewiki/jactor/lpc/TargetActor.java
Expand Up @@ -40,14 +40,14 @@ public interface TargetActor extends Actor {
public void setExceptionHandler(ExceptionHandler exceptionHandler);

/**
* Marks the actor as initialized.
* Marks the actor as active.
*/
public void initialized();
public void activate();

/**
* Returns true when initialized.
* Returns true when active.
*
* @return True when initialized.
* @return True when active.
*/
public boolean isInitialized();
public boolean isActive();
}

0 comments on commit 32c05da

Please sign in to comment.