|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object examples.communication.Launcher
This application launches a number of different types of agents which jump subseqeuently to remote hosts, and communicate with each other.
The launched agents can be three types: SENDER, RECEIVER or TRANSCEIVER. The SENDER agent only sends messages, the RECEIVER agent only receives messages and the TRANSCEIVER agent sends and receives messages.
Field Summary | |
private HashMap |
agentImplicitName_
The HashMap object which contains
the nicknames of the launched agents as keys and
respectively their implicit names as values. |
private HashMap |
agentService_
The HashMap object which contains the
nicknames of the launched agents as keys and respectively
the AgentService interfaces which the agents
have published as values. |
private HashMap |
agentType_
The HashMap object which contains the
nicknames of the launched agents as keys and their
type (1-SENDER, 2-RECEIVER, 3-TRANSCEIVER) as values. |
private Signals |
signals_
The Signals object used to block/unblock
or send terminating signal to the agents threads. |
Fields inherited from interface examples.communication.LauncherService |
PUBLISH_KEY |
Constructor Summary | |
Launcher()
Default constructor. |
Method Summary | |
protected static String |
helpMessage()
This function creates the help message for the application which is going to be written out if the following command line is written: java examples.communication.Launcher -help |
protected void |
informAgents()
Collects the implicit names of receiver and transceiver agents and gives them to the sender and transceiver agents. |
static void |
main(String[] argv)
Creates communication agents and sets some agent properties. |
void |
reportError(String nickName,
Throwable throwable)
When an agent throws an exception(error) it should report it to the others using its nickname and the exception object(error). |
boolean |
reportName(String nickName,
String implicitName,
String servicePath,
int type)
When an agent is created it informs the launcher for his implicit name, nickname, the path under which it has published its AgentService interface
and its type(Sender, Receiver or Transceiver). |
protected void |
terminateAgents()
Terminates all agents which were launched. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private HashMap agentImplicitName_
HashMap
object which contains
the nicknames of the launched agents as keys and
respectively their implicit names as values.
private HashMap agentService_
HashMap
object which contains the
nicknames of the launched agents as keys and respectively
the AgentService
interfaces which the agents
have published as values.
private HashMap agentType_
HashMap
object which contains the
nicknames of the launched agents as keys and their
type (1-SENDER, 2-RECEIVER, 3-TRANSCEIVER) as values.
private Signals signals_
Signals
object used to block/unblock
or send terminating signal to the agents threads.
Constructor Detail |
public Launcher()
Method Detail |
protected static String helpMessage()
public static void main(String[] argv)
argv
- The command line parameters:
-hosts -jumps -sa -st -ra -rt -ta -tt If some(or all) of these parameters are not defined,
the default values will be used.
protected void informAgents()
protected void terminateAgents()
public void reportError(String nickName, Throwable throwable)
LauncherService
reportError
in interface LauncherService
nickName
- the nickname of the agent which throws an
exception
throwable the Throwable
object.throwable
- DOCUMENT ME!LauncherService.reportError(String, Throwable)
public boolean reportName(String nickName, String implicitName, String servicePath, int type)
LauncherService
AgentService
interface
and its type(Sender, Receiver or Transceiver).
reportName
in interface LauncherService
nickName
- the String
representation
of the nickname of the agent.
implicitName the String
representation
of the implicit name of the agent.
servicePath the String
representation
of the path under which the agent has
published its AgentService
.
type 1 = SENDER
2 = RECEIVER
3 = TRANSCEIVERimplicitName
- DOCUMENT ME!servicePath
- DOCUMENT ME!type
- DOCUMENT ME!
LauncherService.reportName(String, String, String, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |