Activity Handler

Activities are an important building block of Spatial Web applications.

In our implementation of hstp.d, Activity Handlers encapsulate the logic that is performed when handling the EXECUTE_ACTIVITY HSTP Operation Request. They have access to an early prototype of a UDG Proxyarrow-up-right, and the ability to use and manage channels via an instance of Channels Managerarrow-up-right.

For more detail about Activities, see section 6.4.4. ACTIVITIES in detail in the IEEE P2874 system specification.

The EXECUTE_ACTIVITY HSTP Operation

To execute an activity, an EXECUTE_ACTIVITY HSTP Operation request is posted to the HSTP.d node. The operation specifies the name of an activity handler to be executed, and a target intended recipient for the operation.

The EXECUTE_ACTIVITY operation handler loads the Activity Handler class by name. In case the node didn't load an activity by that name on construction, the request is delegated to the local actor's mailbox.

If the activity was found and loaded, the Activity Handler's attempt_to_honor_request is called with the HSTP Operation request, and the results returned to the called.

Defining the Activity Handler

  • The Activity Handler class is defined by extending the HSTPServerRequestHandler class

  • The activity's logic is defined in the concrete implementation of the attempt_to_honor_request method.

Loading the Activity Handler

  • All Activity Handlers are loaded to HSTP.d node on construction.

  • The Activity Handler class instances are passed to the HSTP.d node constructor in a {name:class} map. The name will be used in the request to execute the activity.

Executing the Activity

  • The activity is executed by posting an EXECUTE_ACTIVITY HSTP Operation request to the HSTP.d node.

  • The node will load an instance of the named class, and execute the attempt_to_honor_request method.

Parsing the results

  • The HSTP request returns an HSTPOperationResponse

  • The activity's result is returned as an HSTPOperationResponsePayload in the response payload

Last updated