Commands

Commands are implemented as agents and can be run in any node. A command is defined as a description and an agent type and is registered with a unique name.

package org.agilewiki.jasocket.commands;

public class Command {

private String description;

private String type;

public Command(String description, String type) {

this.description = description;

this.type = type;

}

public String description() {

return description;

}

public String type() {

return type;

}

}

The Commands actor is the base class of the registry for commands. Commands are registered when the actor is initialized, so the set of commands is immutable. A convenience method is also provided for registering the command's agent factory.