|
||||||||||
| 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.mts.MessageTransportService
public class MessageTransportService
The message transport service facilitates communication between agents in AFME. If agents are on the local platform, messages are transferred directly. If agents are not on the same platform sockets are used. The message transport service connects to a remote server to receive incomming messages. If the service is operating in synchronous mode, outgoing messages are also sent through the message server. If the service is operating in asynchronous mode, messages are sent in their own socket.
| Constructor Summary | |
|---|---|
MessageTransportService(java.lang.String[] args,
java.lang.Object[] agtNms,
Scheduler scheduler,
Platform plat)
Creates an instance of MessageTransportService. |
|
| Method Summary | |
|---|---|
FOS |
addHolder(FOS name,
java.lang.String performative,
AgentName an,
FOS content,
FOS addresses)
If the service is operating in asynchronous mode, returns a first order structure that represent a message that is to be sent. |
static FOS |
createOutMessage(java.lang.String serverAddress,
FOS agentAddresses,
FOS name,
AgentName senderName,
FOS content)
Creates a first order structure representation of the outgoing message. |
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 message transport service. |
FOS |
processPer(AgentName agentName,
int perceptionID)
Enables the agent to perceive information pertaining to message transport. |
void |
run()
The message transport service periodically connect to a message server. |
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 MessageTransportService(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 FOS addHolder(FOS name,
java.lang.String performative,
AgentName an,
FOS content,
FOS addresses)
throws MalformedLogicException
name - the name of the agent that the message is to be sent to.performative - the performative of the message.an - the name of the ageent that sent the message.content - the information content of the message.addresses - the address of the agent that sent the message.
MalformedLogicException - if there is a logic error.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 static FOS createOutMessage(java.lang.String serverAddress,
FOS agentAddresses,
FOS name,
AgentName senderName,
FOS content)
serverAddress - the address of the server to where the message is being sent.agentAddresses - the sender address.name - the name of the agent the message is being sent to.senderName - the name of the agent sending the message.content - the content of the message.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||