|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AgentService
General super-type defining plug-in services that an agent can invoke from the script.
| Method Summary | |
|---|---|
boolean |
commits()
Answer true if performing an action in this service commits the agent to a course of action that cannot be undone if the script backtracks. |
Agent |
getOwner()
Answer the agent that owns this service instance, or null for a global service. |
KsSymbol |
getPrimaryServiceType()
Answer the main type of service this service instance corresponds to, as a symbol. |
KsSymbol |
getServiceName()
Answer the service identifier |
boolean |
isAlwaysGlobal()
Answer true if instances of this service should always be registered in the global service registry, even if created by a given agent. |
java.util.Iterator |
listServiceTypes()
Answer an iterator over all of the symbols denoting the type of this service |
ActionResult |
performAction(KsAction action,
Intention intent,
KsVar output)
Perform the given action on this service, returning the status of the action (which may only be partially completed). |
void |
setOwner(Agent owner)
Set the agent that is the owner of this registry |
| Method Detail |
|---|
KsSymbol getPrimaryServiceType()
Answer the main type of service this service instance corresponds to, as a
symbol. Typically, this is the most-specific or most salient service type.
To see all of the types of this service, see listServiceTypes().
java.util.Iterator listServiceTypes()
Answer an iterator over all of the symbols denoting the type of this service
KsSymbol getServiceName()
Answer the service identifier
Agent getOwner()
Answer the agent that owns this service instance, or null for a global service.
void setOwner(Agent owner)
Set the agent that is the owner of this registry
owner - The owning agent
ActionResult performAction(KsAction action,
Intention intent,
KsVar output)
Perform the given action on this service, returning the status of the action (which may only be partially completed). If this service cannot perform the named action, throw an unnkown action exception.
action - Expression denoting the action to performintent - The intention that provides the execution context for this service action (including variable bindings)output - Optional variable that can be bound to the output of the service, or
null if no output is expected
UnknownActionExpression - if the action name is not recognisedboolean commits()
Answer true if performing an action in this service commits the agent to a course of action that cannot be undone if the script backtracks.
boolean isAlwaysGlobal()
Answer true if instances of this service should always be registered in the global
service registry, even if created by a given agent. This would be the case, for example,
for some message services (e.g. LocalMessageService
which rely on there being a single global instance to route messages between agents.
By default, services are not forced into the global registry, and it is to be
expected that global services are rare.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||