|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base.agent.utils.runner.impl.AgentRunner<BOT,PARAMS> cz.cuni.amis.pogamut.ut2004.utils.UT2004BotRunner<BOT,PARAMS>
BOT
- PARAMS
- public class UT2004BotRunner<BOT extends IUT2004Bot,PARAMS extends UT2004AgentParameters>
Class used for creating, connecting and starting servers with default settings that are taken from the properties.
The address where the instances will connect are defined either in the constructor
or taken from the properties of the PogamutPlatform
.
For more information about the class see AgentRunner
.
Field Summary | |
---|---|
protected java.lang.String |
host
Default host where the instances are going to be connected as defaults, see IAgentParameters.assignDefaults(IAgentParameters) . |
protected java.lang.String |
name
Default name that will serve as a basis for IAgentId , see IAgentParameters.assignDefaults(IAgentParameters) . |
protected int |
port
Default port where the instances are going to be connected as defaults, see IAgentParameters.assignDefaults(IAgentParameters) . |
Fields inherited from class cz.cuni.amis.pogamut.base.agent.utils.runner.impl.AgentRunner |
---|
agents, consoleLogging, defaultLogLevel, factory, killed, latch, listener, log, main, mutex |
Constructor Summary | |
---|---|
UT2004BotRunner(java.lang.Class<? extends IUT2004BotController> botControllerClass)
Construct the runner without specifying anything as default. |
|
UT2004BotRunner(java.lang.Class<? extends IUT2004BotController> botControllerClass,
java.lang.String name)
Construct the runner + specify the default name, host:port will be taken from the Pogamut platform properties. |
|
UT2004BotRunner(java.lang.Class<? extends IUT2004BotController> botControllerClass,
java.lang.String name,
java.lang.String host,
int port)
Construct the runner + specify all defaults. |
|
UT2004BotRunner(IAgentFactory<BOT,PARAMS> factory)
Construct the runner without specifying anything as default. |
|
UT2004BotRunner(IAgentFactory<BOT,PARAMS> factory,
java.lang.String name)
Construct the runner + specify the default name, host:port will be taken from the Pogamut platform properties. |
|
UT2004BotRunner(IAgentFactory<BOT,PARAMS> factory,
java.lang.String name,
java.lang.String host,
int port)
Construct the runner + specify all defaults. |
|
UT2004BotRunner(UT2004BotModule module)
Construct the runner without specifying anything as default. |
|
UT2004BotRunner(UT2004BotModule module,
java.lang.String name)
Construct the runner + specify the default name, host:port will be taken from the Pogamut platform properties. |
|
UT2004BotRunner(UT2004BotModule module,
java.lang.String name,
java.lang.String host,
int port)
Construct the runner + specify all defaults. |
Method Summary | |
---|---|
java.lang.String |
getHost()
Returns host, where newly launched bots will be connected to. |
java.lang.String |
getName()
Returns name that is going to be used to form new IAgentId of the bots. |
int |
getPort()
Returns port, where newly launched bots will be connected to. |
protected IAgentParameters |
newDefaultAgentParameters()
Provides default parameters that is, IAgentId using name and SocketConnectionAddress
using host and port . |
UT2004BotRunner<BOT,PARAMS> |
setHost(java.lang.String host)
Sets host, where newly launched bots will be connected to. |
UT2004BotRunner<BOT,PARAMS> |
setName(java.lang.String name)
Sets name that is going to be used to form new IAgentId of the bots. |
UT2004BotRunner<BOT,PARAMS> |
setPort(int port)
Sets port, where newly launched bots will be connected to. |
BOT |
startAgent()
Starts the agent by providing default parameters (defined during the construction of the implementor). |
java.util.List<BOT> |
startAgents(int count)
Starts agents by providing every one of them with default parameters (defined during the construction of the implementor). |
java.util.List<BOT> |
startAgents(PARAMS... agentParameters)
Start an agent instance configured with 'agentsParameters'. |
Methods inherited from class cz.cuni.amis.pogamut.base.agent.utils.runner.impl.AgentRunner |
---|
createAgentWithParams, fillInDefaults, fillInDefaults, getLog, isMain, isPausing, killAgent, killAgents, newAgentId, postStartedHook, postStartHook, preInitHook, preResumeHook, preStartHook, setConsoleLogging, setLog, setLogLevel, setMain, setPausing, startAgent, startAgentWithParams, startAgentWithParamsMain |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String host
IAgentParameters.assignDefaults(IAgentParameters)
.
protected int port
IAgentParameters.assignDefaults(IAgentParameters)
.
protected java.lang.String name
IAgentId
, see IAgentParameters.assignDefaults(IAgentParameters)
.
Constructor Detail |
---|
public UT2004BotRunner(IAgentFactory<BOT,PARAMS> factory, java.lang.String name, java.lang.String host, int port)
factory
- to be used for creating new IUT2004Bot
instancesname
- default name that serve as a basis for IAgentId
host
- default host where the instances are going to be connectedport
- default port where the instances are going to be connectedpublic UT2004BotRunner(IAgentFactory<BOT,PARAMS> factory, java.lang.String name)
factory
- factory to be used for creating new IUT2004Bot
instanceslog
- used to log stuffname
- default name that serve as a basis for IAgentId
public UT2004BotRunner(IAgentFactory<BOT,PARAMS> factory)
factory
- factory to be used for creating new IUT2004Bot
instancespublic UT2004BotRunner(UT2004BotModule module, java.lang.String name, java.lang.String host, int port)
module
- Guice module that is going to be used by the UT2004BotFactory
name
- default name that serve as a basis for IAgentId
host
- default host where the instances are going to be connectedport
- default port where the instances are going to be connectedpublic UT2004BotRunner(UT2004BotModule module, java.lang.String name)
module
- Guice module that is going to be used by the UT2004BotFactory
name
- default name that serve as a basis for IAgentId
public UT2004BotRunner(UT2004BotModule module)
module
- Guice module that is going to be used by the UT2004BotFactory
public UT2004BotRunner(java.lang.Class<? extends IUT2004BotController> botControllerClass, java.lang.String name, java.lang.String host, int port)
botControllerClass
- controller that will be used to instantiate UT2004BotModule
, i.e., it will control the UT2004Bot
instancename
- default name that serve as a basis for IAgentId
host
- default host where the instances are going to be connectedport
- default port where the instances are going to be connectedpublic UT2004BotRunner(java.lang.Class<? extends IUT2004BotController> botControllerClass, java.lang.String name)
botControllerClass
- controller that will be used to instantiate UT2004BotModule
, i.e., it will control the UT2004Bot
instancename
- default name that serve as a basis for IAgentId
public UT2004BotRunner(java.lang.Class<? extends IUT2004BotController> botControllerClass)
botControllerClass
- controller that will be used to instantiate UT2004BotModule
, i.e., it will control the UT2004Bot
instanceMethod Detail |
---|
public BOT startAgent() throws PogamutException
IAgentRunner
startAgent
in interface IAgentRunner<BOT extends IUT2004Bot,PARAMS extends UT2004AgentParameters>
startAgent
in class AgentRunner<BOT extends IUT2004Bot,PARAMS extends UT2004AgentParameters>
PogamutException
public java.util.List<BOT> startAgents(int count) throws PogamutException
IAgentRunner
Note that if any instantiation/start of the agent fails, all agents are killed before the method throws the exception.
startAgents
in interface IAgentRunner<BOT extends IUT2004Bot,PARAMS extends UT2004AgentParameters>
startAgents
in class AgentRunner<BOT extends IUT2004Bot,PARAMS extends UT2004AgentParameters>
count
- how many agents should be started
PogamutException
public java.util.List<BOT> startAgents(PARAMS... agentParameters) throws PogamutException
IAgentRunner
Note that if any instantiation/start of the agent fails, all agents are killed before the method throws the exception.
startAgents
in interface IAgentRunner<BOT extends IUT2004Bot,PARAMS extends UT2004AgentParameters>
startAgents
in class AgentRunner<BOT extends IUT2004Bot,PARAMS extends UT2004AgentParameters>
PogamutException
public java.lang.String getName()
IAgentId
of the bots.
public UT2004BotRunner<BOT,PARAMS> setName(java.lang.String name)
IAgentId
of the bots.
If null is passed, generic "UT2004Bot" will be set.
name
- name used for the newly started bots
public java.lang.String getHost()
public UT2004BotRunner<BOT,PARAMS> setHost(java.lang.String host)
host
- host running GB2004 server (can't be null)
public int getPort()
public UT2004BotRunner<BOT,PARAMS> setPort(int port)
port
- at the host where GB2004 server is listening for bot connections
protected IAgentParameters newDefaultAgentParameters()
IAgentId
using name
and SocketConnectionAddress
using host
and port
.
newDefaultAgentParameters
in class AgentRunner<BOT extends IUT2004Bot,PARAMS extends UT2004AgentParameters>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |