Listing 1: The Actor class (with method signatures only)

public class Actor implements TopicSubscriber, ServiceImplementer {

public    Actor(ActorID actorID, JsasbContext jsasbContext);

protected Actor(ActorID actorID, JsasbContext jsasbContext,
String[] upstreamTopics,
String[] downstreamTopics,
String[] supportedServices,
String[] requiredServices);

public ActorID      getActorID();
public JsasbContext getJsasbContext();

public String[] getUpstreamTopics();
public boolean  isUpstreamTopic(String topic);

public String[] getDownstreamTopics();
public boolean  isDownstreamTopic(String topic);

public String[] getSupportedServices();
public boolean  isSupportedService(String service);

public String[] getRequiredServices();
public boolean  isRequiredService(String service);

public void    start();
public void    stop();
public boolean isRunning()

public void   setState(String xml);
public String getState();

// TopicSubscriber
public void onEvent(String topic, Object event);

// ServiceImplementer
public Object onRequest(String service, Object request);
}

Listing 2: The JsasbContext interface

public interface JsasbContext {

TopicPublisher   getSystemPublisher();
ServiceRequester getSystemRequester();

Runnable runnable(Object instance, Method method, Object... arguments);
void execute(Runnable task);
void execute(Runnable task, boolean swing);
void executeLater(Runnable task, long delayMillis);
void executeLater(Runnable task, long delayMillis, boolean swing);
void executeRepeatedly(Runnable task, long delayMillis, long intervalMillis);
void executeRepeatedly(Runnable task, long delayMillis, long intervalMillis, boolean swing);
}

Listing 3: The TopicPublisher interface

public interface TopicPublisher {
void publish(String topic, Object event);
}


Listing 4: The TopicSubscriber interface

public interface TopicSubscriber {
void onEvent(String topic, Object event);
}

Listing 5: The ServiceRequester interface public interface ServiceRequester { Object perform(String service, Object request); }

Listing 6: The ServiceImplementer interface public interface ServiceImplementer { Object onRequest(String service, Object request); }