|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectes.upv.dsic.gti_ia.cAgents.CFactory
public class CFactory
A CFactory starts CProcessors in order to manage conversations. Every CFactory has a CProcessor associated that works as a template for the CProcessors that this CFactory will create. Every CFactory also has a message filter that specifies which type of messages can start new conversations
| Constructor Summary | |
|---|---|
CFactory(String name,
MessageFilter filter,
int conversationsLimit,
CAgent myAgent)
Constructor of the class |
|
| Method Summary | |
|---|---|
CProcessor |
cProcessorTemplate()
Returns the CProcessor that acts as template and will be cloned in order to create new CProcessors |
MessageFilter |
getFilter()
Returns this CFactory's message filter |
int |
getLimit()
Returns how many conversations can a CFactory manage simultaneously |
String |
getName()
Returns this CFactory's name |
protected boolean |
isInitiator()
Returns true if this is initiator, false if this is participant |
void |
setCProcessor(CProcessor proc)
|
void |
setFilter(MessageFilter template)
Sets the message filter that will make this CFactory to start new CProcessors |
protected void |
setInitiator(boolean initiator)
Sets the type of the CFactory |
protected CProcessor |
startConversation(ACLMessage msg,
CProcessor parent,
Boolean isSync)
Creates a new CProcessor that will manage the new conversation |
protected CProcessor |
startConversationWithID(String id,
CProcessor parent,
Boolean isSync)
Creates a new CProcessor that will manage the new conversation |
protected boolean |
templateIsEqual(ACLMessage template)
Returns true if the message matches with the message filter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CFactory(String name,
MessageFilter filter,
int conversationsLimit,
CAgent myAgent)
name - of the CFactoryfilter - message filter that specifies which type of
messages can start new conversationsconversationLimit - how many conversations can a CFactory manage simultaneouslymyAgent - the agent owner of this factory| Method Detail |
|---|
public int getLimit()
public void setFilter(MessageFilter template)
template - message filter that will make this CFactory to start new CProcessorspublic MessageFilter getFilter()
public CProcessor cProcessorTemplate()
protected CProcessor startConversation(ACLMessage msg,
CProcessor parent,
Boolean isSync)
msg - Initial messageparent - CProcessor that start this conversation and acts as parentisSync - True if it is synchronous, false otherwise
protected CProcessor startConversationWithID(String id,
CProcessor parent,
Boolean isSync)
id - The conversation identifier of the new conversationparent - Parent CProcessorisSync - True if it is synchronous, false otherwise
protected boolean templateIsEqual(ACLMessage template)
protected void setInitiator(boolean initiator)
initiator - True if this is a initiator CFactory, false if this is a participant oneprotected boolean isInitiator()
public String getName()
public void setCProcessor(CProcessor proc)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||