|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.agentfactory.cldc.Service
com.agentfactory.cldc.p2pmts.PeerToPeerMTS
public class PeerToPeerMTS
The peer to peer message transport service facilitates communication between agents in AFME in a peer to peer manner. If agents are on the local platform, messages are transferred directly. If agents are not on the same platform, sockets are used.
| Constructor Summary | |
|---|---|
PeerToPeerMTS(java.lang.String[] args,
java.lang.Object[] agtNms,
Scheduler scheduler,
Platform plat)
Creates an instance of PeerToPeerMTS. |
|
| Method Summary | |
|---|---|
boolean |
messageAdd(AgentName targetName,
java.lang.String performative,
AgentName senderName,
java.lang.String url,
FOS content)
Adds a message to the message container of the target agent. |
void |
modifyBinding(java.lang.Object oldName,
java.lang.Object newName)
Changes the name of an agent in the service's registry if one exists. |
FOS |
processAction(AgentName agentName,
int actionID,
FOS action)
Performs an action on the peer to peer message transport service. |
FOS |
processPer(AgentName agentName,
int perceptionID)
Enables the agent to perceive information pertaining to message transport. |
void |
run()
Receives incomming socket connections and adds messages to the service. |
void |
sendOut(java.io.DataOutputStream dos,
java.io.DataInputStream dis,
javax.microedition.io.StreamConnection conn)
Sends messages to the specified data output stream and once finished closes the data output stream, data input stream, and stream connection. |
| Methods inherited from class com.agentfactory.cldc.Service |
|---|
register |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PeerToPeerMTS(java.lang.String[] args,
java.lang.Object[] agtNms,
Scheduler scheduler,
Platform plat)
args - a string of arugments that are passed to the service.agtNms - the names of the agents on the local platform.scheduler - the scheduler that will periodically execute the
run method of the message transport service.plat - the local platform, upon which the agents reside.| Method Detail |
|---|
public void modifyBinding(java.lang.Object oldName,
java.lang.Object newName)
Service
modifyBinding in class ServiceoldName - the old name of the agent.newName - the new name of the agent.public void run()
run in interface java.lang.Runnable
public void sendOut(java.io.DataOutputStream dos,
java.io.DataInputStream dis,
javax.microedition.io.StreamConnection conn)
throws java.io.IOException
dos - the data output stream to write messages to and subsequently close.dis - the data input stream to close.conn - the stream connection to close.
java.io.IOException - if there is an I/O error.
public FOS processPer(AgentName agentName,
int perceptionID)
throws MalformedLogicException
processPer in class ServiceagentName - the agent that wishes to perceive the information.perceptionID - the ID of the information that is to be perceived.
MalformedLogicException - if there is a logic error.
public FOS processAction(AgentName agentName,
int actionID,
FOS action)
throws MalformedLogicException
processAction in class ServiceagentName - the name of the agent that is performing the action.actionID - the ID of the action that is to be performed.action - that data that is to be used in performing the action.
MalformedLogicException - if there is a logic error.
public boolean messageAdd(AgentName targetName,
java.lang.String performative,
AgentName senderName,
java.lang.String url,
FOS content)
targetName - the name of the agent the message is intended for.performative - the performative of the message.senderName - the name of the agent that sent the message.url - the address of the agent that sent the message.content - the information content of the message.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||