cz.cuni.amis.pogamut.udk.utils
Class UDKObserverRunner<OBSERVER extends IUDKObserver,PARAMS extends UDKAgentParameters>

Package class diagram package UDKObserverRunner
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.agent.utils.runner.impl.AgentRunner<OBSERVER,PARAMS>
      extended by cz.cuni.amis.pogamut.udk.utils.UDKObserverRunner<OBSERVER,PARAMS>
All Implemented Interfaces:
IAgentRunner<OBSERVER,PARAMS>

public class UDKObserverRunner<OBSERVER extends IUDKObserver,PARAMS extends UDKAgentParameters>
extends AgentRunner<OBSERVER,PARAMS>

Class used for creating, connecting and starting observers 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.

Author:
ik, Jimmy

Field Summary
protected  String host
          Default host where the instances are going to be connected as defaults, see IAgentParameters.assignDefaults(IAgentParameters).
protected  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, killingAgents, killingAgentsMutex, latch, listener, log, main, mutex
 
Constructor Summary
UDKObserverRunner(IAgentFactory<OBSERVER,PARAMS> factory)
          Construct the runner without specifying anything as default.
UDKObserverRunner(IAgentFactory<OBSERVER,PARAMS> factory, String name)
          Construct the runner + specify the default name, host:port will be taken from the Pogamut platform properties.
UDKObserverRunner(IAgentFactory<OBSERVER,PARAMS> factory, String name, String host, int port)
          Construct the runner + specify all defaults.
 
Method Summary
protected  IAgentParameters newDefaultAgentParameters()
          Provides default parameters that is, IAgentId using name and SocketConnectionAddress using host and port.
 OBSERVER startAgent()
           
 List<OBSERVER> startAgents(int count)
           
 List<OBSERVER> startAgents(PARAMS... agentParameters)
           
 
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

host

protected String host
Default host where the instances are going to be connected as defaults, see IAgentParameters.assignDefaults(IAgentParameters).


port

protected int port
Default port where the instances are going to be connected as defaults, see IAgentParameters.assignDefaults(IAgentParameters).


name

protected String name
Default name that will serve as a basis for IAgentId, see IAgentParameters.assignDefaults(IAgentParameters).

Constructor Detail

UDKObserverRunner

public UDKObserverRunner(IAgentFactory<OBSERVER,PARAMS> factory,
                         String name,
                         String host,
                         int port)
Construct the runner + specify all defaults.

Parameters:
factory - to be used for creating new IUDKObserver instances
name - default name that serve as a basis for IAgentId
host - default host where the instances are going to be connected
port - default port where the instances are going to be connected

UDKObserverRunner

public UDKObserverRunner(IAgentFactory<OBSERVER,PARAMS> factory,
                         String name)
Construct the runner + specify the default name, host:port will be taken from the Pogamut platform properties.

Parameters:
factory - factory to be used for creating new IUDKObserver instances
name - default name that serve as a basis for IAgentId

UDKObserverRunner

public UDKObserverRunner(IAgentFactory<OBSERVER,PARAMS> factory)
Construct the runner without specifying anything as default. Default name for server agents will be "UT2004Observer" and host:port will be taken from the Pogamut platform properties.

Parameters:
factory - factory to be used for creating new IUDKObserver instances
Method Detail

startAgent

public OBSERVER startAgent()
                                         throws cz.cuni.amis.utils.exception.PogamutException
Specified by:
startAgent in interface IAgentRunner<OBSERVER extends IUDKObserver,PARAMS extends UDKAgentParameters>
Overrides:
startAgent in class AgentRunner<OBSERVER extends IUDKObserver,PARAMS extends UDKAgentParameters>
Throws:
cz.cuni.amis.utils.exception.PogamutException

startAgents

public List<OBSERVER> startAgents(int count)
                                                throws cz.cuni.amis.utils.exception.PogamutException
Specified by:
startAgents in interface IAgentRunner<OBSERVER extends IUDKObserver,PARAMS extends UDKAgentParameters>
Overrides:
startAgents in class AgentRunner<OBSERVER extends IUDKObserver,PARAMS extends UDKAgentParameters>
Throws:
cz.cuni.amis.utils.exception.PogamutException

startAgents

public List<OBSERVER> startAgents(PARAMS... agentParameters)
                                                throws cz.cuni.amis.utils.exception.PogamutException
Specified by:
startAgents in interface IAgentRunner<OBSERVER extends IUDKObserver,PARAMS extends UDKAgentParameters>
Overrides:
startAgents in class AgentRunner<OBSERVER extends IUDKObserver,PARAMS extends UDKAgentParameters>
Throws:
cz.cuni.amis.utils.exception.PogamutException

newDefaultAgentParameters

protected IAgentParameters newDefaultAgentParameters()
Provides default parameters that is, IAgentId using name and SocketConnectionAddress using host and port.

Specified by:
newDefaultAgentParameters in class AgentRunner<OBSERVER extends IUDKObserver,PARAMS extends UDKAgentParameters>


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.