agentland.debug
Class AgentPoke

java.lang.Object
  |
  +--agentland.debug.AgentPoke

public class AgentPoke
extends Object

Commandline program to Call up an agent (if it is running), poke it with a method call, and then bail. If no method is supplied, it just runs the agent. Usage: AgentPoke [] [] This can also be run from something other than the command line, but using code akin to the following:

   AgentPoke ap = new AgentPoke();
   ap.setup( societyString, catalogHost );
   ap.setTarget( agentName );
   ap.pokeWithArgs( method, args[] );
 


Constructor Summary
AgentPoke()
           
AgentPoke(Agent pop)
           
AgentPoke(Agent pop, String method, String params)
           
 
Method Summary
static String combineArgs(String[] args)
          Here we combine all the arguments into one string.
static String combineArgs(String[] args, int offset)
           
static Agent findAgent(AgentAgent pop, String agent)
           
static String getDesignationFromString(String s)
           
static String getOccupationFromString(String name)
           
static String getSocietyFromString(String s)
          Static helper methods; originally for the main program
 Agent getTarget()
           
static void main(String[] args)
           
 Object poke(String method, String params)
           
 Object pokeWithArgs(String method, String[] args)
           
 void setTarget(Agent target)
           
 void setTarget(String agentName)
           
 void setup(String society, String catHost)
          Sets up the connection to Metaglue's catalog and such so that we can look up agents.
 void testCatalog()
          Test methods
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentPoke

public AgentPoke()

AgentPoke

public AgentPoke(Agent pop)

AgentPoke

public AgentPoke(Agent pop,
                 String method,
                 String params)
Method Detail

getTarget

public Agent getTarget()

setTarget

public void setTarget(Agent target)

setTarget

public void setTarget(String agentName)

setup

public void setup(String society,
                  String catHost)
Sets up the connection to Metaglue's catalog and such so that we can look up agents.

poke

public Object poke(String method,
                   String params)
            throws CallerFailedException

pokeWithArgs

public Object pokeWithArgs(String method,
                           String[] args)
                    throws CallerFailedException

testCatalog

public void testCatalog()
Test methods

getSocietyFromString

public static String getSocietyFromString(String s)
Static helper methods; originally for the main program

getOccupationFromString

public static String getOccupationFromString(String name)

getDesignationFromString

public static String getDesignationFromString(String s)

findAgent

public static Agent findAgent(AgentAgent pop,
                              String agent)

combineArgs

public static String combineArgs(String[] args)
Here we combine all the arguments into one string. I think we do this to make it look like the AgentTester call, so this should probably be reworked not to do this in the future.

combineArgs

public static String combineArgs(String[] args,
                                 int offset)

main

public static void main(String[] args)