|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object kaos.core.csi.request.RequestManagerImpl
public class RequestManagerImpl
This class implements the RequestManager interface, which defines sending requests to entities implementing RequestReceiver interfaces.
Nested Class Summary | |
---|---|
protected static class |
RequestManagerImpl.OperationWaiter
This class is used as a helper class to block Threads invoking the synchronous 'requestAction' methods. |
Field Summary | |
---|---|
protected java.util.Hashtable |
_actionRequestors
|
protected Locator |
_myLocator
|
protected java.lang.String |
_nickname
|
protected QueryRegistration |
_query
|
protected TransportSupport |
_transport
|
protected java.lang.String |
_transportName
|
protected java.util.Hashtable |
_waiters
|
Method Summary | |
---|---|
void |
assertNotLocatable(boolean exp,
java.lang.String msg)
|
boolean |
equals(java.lang.Object obj)
Two agents are equal if their respective hash codes are equal. |
static RequestManager |
getInstance(java.lang.String transportName)
Retrieve a reference to the RequestManager. |
int |
hashCode()
Determines the hash code for the AgentUsecase. |
static void |
main(java.lang.String[] args)
|
void |
onAborted(java.util.Calendar time,
java.lang.Object reason,
java.lang.String actionID,
java.lang.String actionExecutorID)
Forward the action aborted info from the given action executor to the feedback receiver associated with the requested action identified by the given actionID. |
void |
onAccepted(java.util.Calendar time,
java.lang.Object acceptInfo,
java.lang.String actionID,
java.lang.String actionExecutorID)
Forward the accept info by the action executor to the feedback receiver associated with the requested action identified by the given actionID. |
void |
onCompleted(java.util.Calendar time,
java.lang.Object result,
java.lang.String actionID,
java.lang.String actionExecutorID)
Forward the result of the action executed by the given action executor to the feedback receiver associated with the requested action identified by the given actionID. |
void |
onRefused(java.util.Calendar time,
java.lang.Object reason,
java.lang.String actionID,
java.lang.String actionExecutorID)
Forward the reason for refusal by the action executor to the feedback receiver associated with the requested action identified by the given actionID. |
void |
onStarted(java.util.Calendar time,
java.lang.Object startedInfo,
java.lang.String actionID,
java.lang.String actionExecutorID)
Forward the action started info from the given action executor to the feedback receiver associated with the requested action identified by the given actionID. |
protected void |
printDebugString(java.lang.String msg,
int loggerDisplayLevel)
|
void |
receiveKAoSStatus(java.lang.String statusMsg,
java.lang.String actionID,
java.lang.String robotID)
Receive a status message describing the execution of the requested action. |
void |
receiveMessage(TransportMessage tmsg)
Implements the receiveMessage method mandated by the MessageListener interface. |
protected void |
removeWaiter(java.lang.String id)
|
protected MethodCallResultMsg |
satisfyRequest(MethodCallRequestMsg requestMsg)
kaos.core.csi.command.FeedbackReceiver interface implementation - end |
java.lang.String |
sendAIDRequest(FeedbackReceiver feedbackReceiver,
KAoSEntityDescription receiverDesc,
ActionInstanceDescription aid)
This method sends a request to an entity identified by the given receiverDesc to perform an action described by the given ActionInstanceDescription. |
java.lang.String |
sendAIDRequest(FeedbackReceiver feedbackReceiver,
java.lang.String receiverID,
ActionInstanceDescription aid)
This method sends a request to an entity identified by the given receiverID to perform an action described by the given ActionInstanceDescription. |
java.lang.Object |
sendAIDRequest(KAoSEntityDescription receiverDesc,
ActionInstanceDescription aid)
This method sends a request described by an ActionInstanceDescription to perform an action by an entity identified by the KAoSEntityDescription. |
java.lang.Object |
sendAIDRequest(java.lang.String receiverID,
ActionInstanceDescription aid)
This method sends a request described by an ActionInstanceDescription to perform an action by an entity identified by the receiverID. |
java.lang.String |
sendHashMapRequest(FeedbackReceiver feedbackReceiver,
KAoSEntityDescription receiverDesc,
java.lang.String actionName)
This method sends a request to an entity identified by the given receiverDesc to perform an action described by the given String. |
java.lang.String |
sendHashMapRequest(FeedbackReceiver feedbackReceiver,
KAoSEntityDescription receiverDesc,
java.lang.String actionName,
java.util.HashMap properties)
This method sends a request to an entity identified by the given receiverDesc to perform an action described by the given String and a HashMap containing the action properties. |
java.lang.String |
sendHashMapRequest(FeedbackReceiver feedbackReceiver,
java.lang.String receiverID,
java.lang.String actionName)
This method sends a request to an entity identified by the given receiverID to perform an action described by the given String. |
java.lang.String |
sendHashMapRequest(FeedbackReceiver feedbackReceiver,
java.lang.String receiverID,
java.lang.String actionName,
java.util.HashMap properties)
This method sends a request to an entity identified by the given receiverID to perform an action described by the given String and a HashMap containing the action properties. |
java.lang.Object |
sendHashMapRequest(KAoSEntityDescription receiverDesc,
java.lang.String actionName)
This method sends a request described by a String and a HashMap containing the action properties to perform by an entity identified by the KAoSEntityDescription. |
java.lang.Object |
sendHashMapRequest(KAoSEntityDescription receiverDesc,
java.lang.String actionName,
java.util.HashMap properties)
This method sends a request described by a String and a HashMap containing the action properties to perform by an entity identified by the KAoSEntityDescription. |
java.lang.Object |
sendHashMapRequest(java.lang.String receiverID,
java.lang.String actionName)
This method sends a request described by the given String containing the action name to perform the action by an entity identified by the receiverID. |
java.lang.Object |
sendHashMapRequest(java.lang.String receiverID,
java.lang.String actionName,
java.util.HashMap properties)
This method sends a request described by the given String and a HashMap containing the action properties to perform an action by an entity identified by the receiverID. |
java.lang.String |
sendOWLRequest(FeedbackReceiver feedbackReceiver,
KAoSEntityDescription receiverDesc,
java.lang.String owlActionDescription)
This method sends a request to an entity identified by the given receiverDesc to perform an action described by the given String, which is in the OWL format. |
java.lang.String |
sendOWLRequest(FeedbackReceiver feedbackReceiver,
java.lang.String receiverID,
java.lang.String owlActionDescription)
This method sends a request to an entity identified by the given receiverID to perform an action described by the given String, which is in the OWL format. |
java.lang.Object |
sendOWLRequest(KAoSEntityDescription receiverDesc,
java.lang.String owlActionDescription)
This method sends a request described by an OWL String to perform an action by an entity identified by the KAoSEntityDescription. |
java.lang.Object |
sendOWLRequest(java.lang.String receiverID,
java.lang.String owlActionDescription)
This method sends a request described by an OWL String to perform an action by an entity identified by the receiverID. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Locator _myLocator
protected java.lang.String _nickname
protected QueryRegistration _query
protected TransportSupport _transport
protected java.lang.String _transportName
protected java.util.Hashtable _actionRequestors
protected java.util.Hashtable _waiters
Method Detail |
---|
public static RequestManager getInstance(java.lang.String transportName) throws java.lang.Exception
transportName
- is a String containing the name of the transport to use by the RequestManager.nickName
- is a String containing the nick name of the RequestManager that may be used by certain
transport implementations, or null if not required by the transport.
java.lang.Exception
public java.lang.String sendHashMapRequest(FeedbackReceiver feedbackReceiver, java.lang.String receiverID, java.lang.String actionName, java.util.HashMap properties) throws ActionFailureException, NotLocatableException, TransportFailure
sendHashMapRequest
in interface HashMapRequestManager
feedbackReceiver
- is the FeedbackReceiver requesting the action.
All feedback from the action execution will be sent to it.receiverID
- is the String that identifies the entity, which is
requested to perform the action. The receiverID is the one
that the action executor has registered with KAoS.actionName
- is a String representing the name of the action as defined in
the associated ontology.properties
- is a HashMap of ontological Strings representing
the desired properties of the action and the
associated values.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public java.lang.String sendHashMapRequest(FeedbackReceiver feedbackReceiver, java.lang.String receiverID, java.lang.String actionName) throws ActionFailureException, NotLocatableException, TransportFailure
sendHashMapRequest
in interface HashMapRequestManager
feedbackReceiver
- is the FeedbackReceiver requesting the action.
All feedback from the action execution will be sent to it.receiverID
- is the String that identifies the entity, which is
requested to perform the action. The receiverID is the one
that the action executor has registered with KAoS.actionName
- is a String representing the name of the action as defined in
the associated ontology.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public java.lang.String sendHashMapRequest(FeedbackReceiver feedbackReceiver, KAoSEntityDescription receiverDesc, java.lang.String actionName, java.util.HashMap properties) throws ActionFailureException, NotLocatableException, TransportFailure
sendHashMapRequest
in interface HashMapRequestManager
feedbackReceiver
- is the FeedbackReceiver requesting the action.
All feedback from the action execution will be sent to it.receiverDesc
- is a KAosEntityDescription of the entity, which is requested
to perform the action.actionName
- is a String representing the name of the action as defined in
the associated ontology.properties
- is a HashMap of ontological Strings representing
the desired properties of the action and the
associated values.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public java.lang.String sendHashMapRequest(FeedbackReceiver feedbackReceiver, KAoSEntityDescription receiverDesc, java.lang.String actionName) throws ActionFailureException, NotLocatableException, TransportFailure
sendHashMapRequest
in interface HashMapRequestManager
feedbackReceiver
- is the FeedbackReceiver requesting the action.
All feedback from the action execution will be sent to it.receiverDesc
- is a KAosEntityDescription of the entity, which is requested
to perform the action.actionName
- is a String representing the name of the action as defined in
the associated ontology.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public java.lang.Object sendHashMapRequest(java.lang.String receiverID, java.lang.String actionName, java.util.HashMap properties) throws ActionFailureException, NotLocatableException, TransportFailure
sendHashMapRequest
in interface HashMapRequestManager
receiverID
- is the String that identifies the entity, which is
requested to perform the action. The receiverID is the one
that the action executor has registered with KAoS.actionName
- is a String representing the name of the action as defined in
the associated ontology.properties
- is a HashMap of ontological Strings representing
the desired properties of the action and the
associated values.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public java.lang.Object sendHashMapRequest(java.lang.String receiverID, java.lang.String actionName) throws ActionFailureException, NotLocatableException, TransportFailure
sendHashMapRequest
in interface HashMapRequestManager
receiverID
- is the String that identifies the entity, which is
requested to perform the action. The receiverID is the one
that the action executor has registered with KAoS.actionName
- is a String representing the name of the action as defined in
the associated ontology.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public java.lang.Object sendHashMapRequest(KAoSEntityDescription receiverDesc, java.lang.String actionName, java.util.HashMap properties) throws ActionFailureException, NotLocatableException, TransportFailure
sendHashMapRequest
in interface HashMapRequestManager
receiverDesc
- is the KAoSEntityDescription that identifies the entity, which is
requested to perform the action.actionName
- is a String representing the name of the action as defined in
the associated ontology.properties
- is a HashMap of ontological Strings representing
the desired properties of the action and the
associated values.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public java.lang.Object sendHashMapRequest(KAoSEntityDescription receiverDesc, java.lang.String actionName) throws ActionFailureException, NotLocatableException, TransportFailure
sendHashMapRequest
in interface HashMapRequestManager
receiverDesc
- is the KAoSEntityDescription that identifies the entity, which is
requested to perform the action.actionName
- is a String representing the name of the action as defined in
the associated ontology.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public java.lang.String sendAIDRequest(FeedbackReceiver feedbackReceiver, java.lang.String receiverID, ActionInstanceDescription aid) throws ActionFailureException, NotLocatableException, TransportFailure
sendAIDRequest
in interface AIDRequestManager
feedbackReceiver
- is the FeedbackReceiver requesting the action.
All feedback from the action execution will be sent to it.receiverID
- is the String that identifies the entity, which is
requested to perform the action. The receiverID is the one
that the action executor has registered with KAoS.aid
- is an ActionInstanceDescription that describes the action.
It includes the action name and all action properties and their values.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public java.lang.String sendAIDRequest(FeedbackReceiver feedbackReceiver, KAoSEntityDescription receiverDesc, ActionInstanceDescription aid) throws ActionFailureException, NotLocatableException, TransportFailure
sendAIDRequest
in interface AIDRequestManager
feedbackReceiver
- is the FeedbackReceiver requesting the action.
All feedback from the action execution will be sent to it.receiverDesc
- is a KAosEntityDescription of the entity, which is requested
to perform the action.aid
- is an ActionInstanceDescription that describes the action.
It includes the action name and all action properties and their values.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public java.lang.Object sendAIDRequest(java.lang.String receiverID, ActionInstanceDescription aid) throws ActionFailureException, NotLocatableException, TransportFailure
sendAIDRequest
in interface AIDRequestManager
receiverID
- is the String that identifies the entity, which is
requested to perform the action. The receiverID is the one
that the action executor has registered with KAoS.aid
- is an ActionInstanceDescription that describes the action.
It includes the action name and all action properties and their values.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public java.lang.Object sendAIDRequest(KAoSEntityDescription receiverDesc, ActionInstanceDescription aid) throws ActionFailureException, NotLocatableException, TransportFailure
sendAIDRequest
in interface AIDRequestManager
receiverDesc
- is the KAoSEntityDescription that identifies the entity, which is
requested to perform the action.aid
- is an ActionInstanceDescription that describes the action.
It includes the action name and all action properties and their values.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public java.lang.String sendOWLRequest(FeedbackReceiver feedbackReceiver, java.lang.String receiverID, java.lang.String owlActionDescription) throws ActionFailureException, NotLocatableException, TransportFailure
sendOWLRequest
in interface OWLRequestManager
feedbackReceiver
- is the FeedbackReceiver requesting the action.
All feedback from the action execution will be sent to it.receiverID
- is the String that identifies the entity, which is
requested to perform the action. The receiverID is the one
that the action executor has registered with KAoS.owlActionDescription
- is an OWL String that describes the action.
It includes the action name and all action properties and their values.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public java.lang.String sendOWLRequest(FeedbackReceiver feedbackReceiver, KAoSEntityDescription receiverDesc, java.lang.String owlActionDescription) throws ActionFailureException, NotLocatableException, TransportFailure
sendOWLRequest
in interface OWLRequestManager
feedbackReceiver
- is the FeedbackReceiver requesting the action.
All feedback from the action execution will be sent to it.receiverDesc
- is a KAosEntityDescription of the entity, which is requested
to perform the action.owlActionDescription
- is an OWL String that describes the action.
It includes the action name and all action properties and their values.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public java.lang.Object sendOWLRequest(java.lang.String receiverID, java.lang.String owlActionDescription) throws ActionFailureException, NotLocatableException, TransportFailure
sendOWLRequest
in interface OWLRequestManager
receiverID
- is the String that identifies the entity, which is
requested to perform the action. The receiverID is the one
that the action executor has registered with KAoS.owlActionDescription
- is an OWL String that describes the action.
It includes the action name and all action properties and their values.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public java.lang.Object sendOWLRequest(KAoSEntityDescription receiverDesc, java.lang.String owlActionDescription) throws ActionFailureException, NotLocatableException, TransportFailure
sendOWLRequest
in interface OWLRequestManager
receiverDesc
- is the KAoSEntityDescription that identifies the entity, which is
requested to perform the action.owlActionDescription
- is an OWL String that describes the action.
It includes the action name and all action properties and their values.
ActionFailureException
- containing the reason for failure.
See ontology to determine specific reasons available for
a given action
NotLocatableException
- when the entity reqested to perform the action cannot be located.
TransportFailure
- when the request cannot be sent due to transport failure.public void receiveMessage(TransportMessage tmsg)
MessageListener
,
TransportMessage
,
"JAS Specification, Section(s) 3.4.2, 4.7.2"public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
hashCode()
,
"JAS Specification, Section(s) 4.7.2"public int hashCode()
super.hashCode()
.
hashCode
in class java.lang.Object
AgentName#hashCode
,
Object.hashCode()
,
"JAS Specification, Section(s) 4.7.2"public void onAccepted(java.util.Calendar time, java.lang.Object acceptInfo, java.lang.String actionID, java.lang.String actionExecutorID)
onAccepted
in interface FeedbackReceiver
time
- Calendar time of acceptance.acceptInfo
- Object containing additional (optional) info about the acceptance.actionID
- String containing the id of the requested action/information.actionExecutorID
- String containing the name of the entity performing the action.public void onRefused(java.util.Calendar time, java.lang.Object reason, java.lang.String actionID, java.lang.String actionExecutorID)
onRefused
in interface FeedbackReceiver
time
- Calendar time of refusal.reason
- Object containing the reason for refusing the request.actionID
- String containing the id of the requested action/information.actionExecutorID
- String containing the name of the entity performing the action.public void onCompleted(java.util.Calendar time, java.lang.Object result, java.lang.String actionID, java.lang.String actionExecutorID)
onCompleted
in interface FeedbackReceiver
time
- Calendar time of information/action completion.result
- Object containing the result of the requested action.actionID
- String containing the id of the requested action/information.actionExecutorID
- String containing the name of the robot performing the action.public void onStarted(java.util.Calendar time, java.lang.Object startedInfo, java.lang.String actionID, java.lang.String actionExecutorID)
onStarted
in interface FeedbackReceiver
time
- Calendar time of starting an action.startedInfo
- Object containing additional (optional) info about the start of the action.actionID
- String containing the id of the requested action/information.actionExecutorID
- String containing the name of the entity performing the action.public void onAborted(java.util.Calendar time, java.lang.Object reason, java.lang.String actionID, java.lang.String actionExecutorID)
onAborted
in interface FeedbackReceiver
time
- Calendar time of aborting an action.reason
- Object containing the reason for aborting an action.actionID
- String containing the id of the requested action/information.actionExecutorID
- String containing the name of the robot performing the action.public void receiveKAoSStatus(java.lang.String statusMsg, java.lang.String actionID, java.lang.String robotID)
receiveKAoSStatus
in interface FeedbackReceiver
statusMsg
- Object containing the result of the requested action/information.actionID
- String containing the id of the requested action/information.robotID
- String containing the name of the robot performing the action.protected MethodCallResultMsg satisfyRequest(MethodCallRequestMsg requestMsg)
public void assertNotLocatable(boolean exp, java.lang.String msg) throws NotLocatableException
NotLocatableException
- if exp is true.protected void removeWaiter(java.lang.String id)
protected void printDebugString(java.lang.String msg, int loggerDisplayLevel)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |