Skip to content

Commit

Permalink
Only JBActor's can be called
Browse files Browse the repository at this point in the history
  • Loading branch information
laforge49 committed Feb 29, 2012
1 parent 8069b6f commit dc0686a
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 24 deletions.
Expand Up @@ -23,7 +23,6 @@
*/
package org.agilewiki.jactor.bind;

import org.agilewiki.jactor.Actor;
import org.agilewiki.jactor.apc.APCRequestSource;

/**
Expand All @@ -39,7 +38,7 @@ public class ConstrainedRequest<RESPONSE_TYPE> extends Request<RESPONSE_TYPE> {
* @return The response.
* @throws Exception Any uncaught exceptions raised while processing the request.
*/
public RESPONSE_TYPE call(Internals sourceInternals, Actor targetActor) throws Exception {
public RESPONSE_TYPE call(Internals sourceInternals, JBActor targetActor) throws Exception {
return (RESPONSE_TYPE) sourceInternals.call(targetActor, this);
}

Expand All @@ -52,7 +51,7 @@ public RESPONSE_TYPE call(Internals sourceInternals, Actor targetActor) throws E
* @return The response.
* @throws Exception Any uncaught exceptions raised while processing the request.
*/
public RESPONSE_TYPE call(APCRequestSource requestSource, Actor targetActor)
public RESPONSE_TYPE call(APCRequestSource requestSource, JBActor targetActor)
throws Exception {
return (RESPONSE_TYPE) targetActor.acceptCall(requestSource, this);
}
Expand Down
@@ -1,7 +1,5 @@
package org.agilewiki.jactor.bind;

import org.agilewiki.jactor.Actor;

/**
* Requests that can be called from outside an actor.
*/
Expand All @@ -14,7 +12,7 @@ public class ExternallyCallableRequest<RESPONSE_TYPE> extends ConstrainedRequest
* @return The response.
* @throws Exception Any uncaught exceptions raised while processing the request.
*/
public RESPONSE_TYPE call(Actor targetActor)
public RESPONSE_TYPE call(JBActor targetActor)
throws Exception {
return (RESPONSE_TYPE) targetActor.acceptCall(null, this);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/agilewiki/jactor/bind/JBActor.java
Expand Up @@ -73,7 +73,7 @@ final public ConcurrentSkipListMap<String, Object> getData() {
* @return The actor's parent, or null.
*/
@Override
final public Actor getParent() {
final public JBActor getParent() {
return JBActor.this.getParent();
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/agilewiki/jactor/bind/RequestReceiver.java
Expand Up @@ -23,7 +23,6 @@
*/
package org.agilewiki.jactor.bind;

import org.agilewiki.jactor.Actor;
import org.agilewiki.jactor.Mailbox;
import org.agilewiki.jactor.RP;
import org.agilewiki.jactor.lpc.RequestSource;
Expand All @@ -46,7 +45,7 @@ public interface RequestReceiver {
*
* @return The actor's parent, or null.
*/
Actor getParent();
JBActor getParent();

/**
* Returns true when the concurrent data of the parent contains the named data item.
Expand Down
Expand Up @@ -23,8 +23,8 @@
*/
package org.agilewiki.jactor.components.actorRegistry;

import org.agilewiki.jactor.Actor;
import org.agilewiki.jactor.bind.ConcurrentMethodBinding;
import org.agilewiki.jactor.bind.JBActor;
import org.agilewiki.jactor.bind.RequestReceiver;
import org.agilewiki.jactor.bind.VoidConcurrentMethodBinding;
import org.agilewiki.jactor.components.Component;
Expand Down Expand Up @@ -100,7 +100,7 @@ public JCActor concurrentProcessRequest(RequestReceiver requestReceiver,
String name = request.getName();
JCActor registeredActor = registry.get(name);
if (registeredActor == null && parentHasSameComponent()) {
Actor parent = requestReceiver.getParent();
JBActor parent = requestReceiver.getParent();
return request.call(parent);
}
return registeredActor;
Expand Down
Expand Up @@ -23,8 +23,8 @@
*/
package org.agilewiki.jactor.components.properties;

import org.agilewiki.jactor.Actor;
import org.agilewiki.jactor.bind.ConcurrentMethodBinding;
import org.agilewiki.jactor.bind.JBActor;
import org.agilewiki.jactor.bind.RequestReceiver;
import org.agilewiki.jactor.bind.VoidConcurrentMethodBinding;
import org.agilewiki.jactor.components.Component;
Expand Down Expand Up @@ -75,7 +75,7 @@ public Object concurrentProcessRequest(RequestReceiver requestReceiver,
String name = request.getPropertyName();
Object value = properties.get(name);
if (value == null && parentHasSameComponent()) {
Actor parent = requestReceiver.getParent();
JBActor parent = requestReceiver.getParent();
return request.call(parent);
}
return value;
Expand Down
@@ -1,7 +1,6 @@
package org.agilewiki.jactor.bind;

import junit.framework.TestCase;
import org.agilewiki.jactor.Actor;
import org.agilewiki.jactor.JAMailboxFactory;
import org.agilewiki.jactor.Mailbox;
import org.agilewiki.jactor.MailboxFactory;
Expand All @@ -11,7 +10,7 @@ public void test1() {
System.err.println("test1");
MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
try {
Actor a = new A(mailboxFactory.createMailbox());
JBActor a = new A(mailboxFactory.createMailbox());
System.err.println((new Hi()).call(a));
} catch (Exception e) {
e.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/agilewiki/jactor/bind/EventTest.java
Expand Up @@ -7,7 +7,7 @@ public class EventTest extends TestCase {
public void test() {
MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
try {
Actor a = new A(mailboxFactory.createMailbox());
JBActor a = new A(mailboxFactory.createMailbox());
JAFuture future = new JAFuture();
Hi hi = new Hi();
hi.sendEvent(a);
Expand Down
@@ -1,7 +1,6 @@
package org.agilewiki.jactor.components.factory;

import junit.framework.TestCase;
import org.agilewiki.jactor.Actor;
import org.agilewiki.jactor.JAMailboxFactory;
import org.agilewiki.jactor.MailboxFactory;
import org.agilewiki.jactor.components.Include;
Expand All @@ -17,7 +16,7 @@ public void test1() {
(new Include(Factory.class)).call(f);
(new Include(ActorRegistry.class)).call(f);
(new DefineActorType("Foo", Foo.class)).call(f);
Actor a = (new NewActor("Foo")).call(f);
JCActor a = (new NewActor("Foo")).call(f);
(new Hi()).call(a);
} catch (Exception e) {
e.printStackTrace();
Expand All @@ -35,7 +34,7 @@ public void test2() {
(new Include(Factory.class)).call(f);
(new Include(ActorRegistry.class)).call(f);
(new DefineActorType("Bar", Bar.class)).call(f);
Actor a = (new NewActor("Bar", null, "Bloop")).call(f);
JCActor a = (new NewActor("Bar", null, "Bloop")).call(f);
(new Hi()).call(a);
} catch (Exception e) {
e.printStackTrace();
Expand Down
Expand Up @@ -10,7 +10,7 @@ public void test() {
MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
try {
Mailbox mailbox = mailboxFactory.createMailbox();
Actor publisher = new JCActor(mailbox);
JCActor publisher = new JCActor(mailbox);
JAFuture future = new JAFuture();
(new Include(PubSub.class)).call(publisher);
Actor subscriber1 = new Subscriber(mailbox);
Expand Down
Expand Up @@ -48,10 +48,10 @@ public void test() {
MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(t);
try {
JAFuture future = new JAFuture();
Actor[] drivers = new Actor[p];
Actor[] drivers = new JCActor[p];
int i = 0;
while (i < p) {
Actor driver = new JCActor(mailboxFactory.createAsyncMailbox());
JCActor driver = new JCActor(mailboxFactory.createAsyncMailbox());
driver.setInitialBufferCapacity(b + 10);
(new Include(Driver.class)).call(driver);
drivers[i] = driver;
Expand Down
Expand Up @@ -58,7 +58,7 @@ public void test() {
int i = 0;
while (i < p) {
Mailbox sharedMailbox = mailboxFactory.createAsyncMailbox();
Actor driver = new JCActor(sharedMailbox);
JCActor driver = new JCActor(sharedMailbox);
(new Include(Driver1.class)).call(driver);
drivers[i] = driver;
int j = 0;
Expand Down
Expand Up @@ -51,7 +51,7 @@ public void test() {
Actor[] drivers = new Actor[p];
int i = 0;
while (i < p) {
Actor driver = new JCActor(mailboxFactory.createAsyncMailbox());
JCActor driver = new JCActor(mailboxFactory.createAsyncMailbox());
driver.setInitialBufferCapacity(b + 10);
(new Include(Driver.class)).call(driver);
drivers[i] = driver;
Expand Down

0 comments on commit dc0686a

Please sign in to comment.