Working with the SpaceResultHandler Project

The SpaceResultHandler project contains five processes that show how to use TIBCO ActiveMatrix BusinessWorks Plug-in for ActiveSpaces to perform asynchronous operations.

The SpaceResultHandler project contains the following processes:

  • Operations.bwp process
  • PutHandler.bwp process
  • TakeHandler.bwp process
  • LockHandler.bwp process
  • Unlockhandler process

The Operations.bwp process shows how to perform asynchronous operations in a space. The process is designed with the following activities:

The following table describes the activities in this process:

Activity Description
Timer Starts the process.
Sleep Suspends the process on the current transition for a specified time to wait for the SpaceResultHandler activities in the PutHandler.bwp, TakeHandler.bwp, LockHandler.bwp, and Unlockhandler processes to initialize within the specified time.
Put Stores tuples in the space.
Put_Async Put activity with the asynchronous operation enabled. The Put_Async activity stores a tuple in the space asynchronously.
Take_Async Take activity with the asynchronous operation enabled. The Take_Async activity retrieves and removes the tuple in the space asynchronously.
Lock_Async Lock activity with the asynchronous operation enabled. The Lock_Async activity locks the key of the tuple in the space asynchronously.
UnLock_Async UnLock activity with the asynchronous operation enabled. The UnLock_Async activity clears the lock on the key of the tuple in the space asynchronously.
SpaceSize Counts the number of the tuples in the space.

The PutHandler.bwp, TakeHandler.bwp, LockHandler.bwp, and Unlockhandler processes show the corresponding results of the asynchronous operations of different types. These processes are designed with the following activity:

Activity Description
SpaceResultHandler Displays the results of the asynchronous operations of different types:
  • The SpaceResultHandler activity in the PutHandler.bwp process displays only the first tuple stored by the Put activity, and returns the closed data transferred in the Put asynchronous operation.
  • The SpaceResultHandler activity in the TakeHandler.bwp process displays the tuples removed by the Take_Async activity, and returns the closed data transferred in the Take asynchronous operation.
  • The SpaceResultHandler activity in the LockHandler.bwp process displays the tuples locked by the Lock_Async activity, and returns the closed data transferred in the Lock asynchronous operation.
  • The SpaceResultHandler activity in the Unlockhandler process displays the tuples unlocked by the UnLock_Async activity, and returns the closed data transferred in the Unlock asynchronous operation.