|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmadkit.kernel.AbstractAgent
madkit.kernel.Agent
madkit.netcomm.MadkitNetworkAgent
madkit.netcomm.NetAgent
public class NetAgent
The NetAgent replaces the Communicator. For the outside agents the communications behave the save way. The NetAgent can be configured to automatically broadcast the presence of the Kernel using @link NetAgent# setAutoBroadcast()
| Field Summary |
|---|
| Fields inherited from class madkit.netcomm.MadkitNetworkAgent |
|---|
community, group, memberCard, myKernel |
| Constructor Summary | |
|---|---|
NetAgent()
|
|
NetAgent(int p)
|
|
| Method Summary | |
|---|---|
void |
activate()
This methods has been overloaded to initialize some of the variables provided by this agent. |
void |
connectAgency(java.lang.String kernelName,
java.lang.String host,
int port)
|
void |
connectKernel(java.lang.String host,
int port)
Requests the connection of the kernel at host:port |
void |
end()
This method is called by the agent micro-kernel at the end of the agent lifecycle. |
int |
getPort()
|
protected void |
handleConfigMessage(NetConfigMessage message)
Handles the Configuration messages. |
protected void |
handleNetworkMessage(NetworkMessage message)
Handles the internal messages. |
protected void |
handlePersonalMessage(StringMessage m)
|
void |
initGUI()
This method is called by the specific external graphic system (as the G-Box) to ask the agent to prepare a graphical interface. |
boolean |
isAutoBroadcast()
|
void |
live()
This method defines the main behavior for threaded agents. |
boolean |
madkitBroadcast()
Broadcasts the presence of the kernel. |
void |
setAutoBroadcast(boolean autoBroadcast)
If the autoBroadcast is set to true, it broadcasts the presence of the kernel. |
| Methods inherited from class madkit.netcomm.MadkitNetworkAgent |
|---|
bytesReceived, bytesSent, debug, fatatError, fatatError, getReceivedBytesCount, getSentBytesCount, print, println, reset |
| Methods inherited from class madkit.kernel.Agent |
|---|
connectAgencyToAgency, createPlace, createPlace, enableMobility, enableMobility, exitImmediatlyOnKill, getAgencyNamed, joinPlace, joinPlace, joinPlace, pause, receiveMessage, run, waitNextMessage, waitNextMessage |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NetAgent()
public NetAgent(int p)
| Method Detail |
|---|
public void live()
Agent
live in class Agentpublic void activate()
MadkitNetworkAgent
activate in class MadkitNetworkAgentAbstractAgent.activate()public void end()
AbstractAgent
end in class AbstractAgentpublic void initGUI()
AbstractAgent
initGUI in class AbstractAgentpublic int getPort()
protected void handleNetworkMessage(NetworkMessage message)
MadkitNetworkAgent
handleNetworkMessage in class MadkitNetworkAgentNetworkMessageprotected void handleConfigMessage(NetConfigMessage message)
MadkitNetworkAgent
handleConfigMessage in class MadkitNetworkAgentNetConfigMessageprotected void handlePersonalMessage(StringMessage m)
public void connectKernel(java.lang.String host,
int port)
host - Distant hostport -
public void connectAgency(java.lang.String kernelName,
java.lang.String host,
int port)
connectAgency in interface Communicatorpublic boolean madkitBroadcast()
public boolean isAutoBroadcast()
public void setAutoBroadcast(boolean autoBroadcast)
autoBroadcast - The autoBroadcast to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||