ICppWorker Interface Reference

List of all members.


Detailed Description

Provides the interface for a processing unit worker.

The processing unit class should inherit from ICppWorker and implement its callback methods.

Public Member Functions

virtual const char * className ()=0
 Returns the name of the worker class.
virtual bool Destroy ()=0
 Called prior to the worker becoming eligible for unload.
virtual bool Initialize (IWorkerPeer *Host)=0
 Holds any initialization code.
virtual CommandObjectPtr run (CommandObjectPtr work)=0
 Executes the worker's processing code.
virtual ~ICppWorker ()
 Destructor.


Constructor & Destructor Documentation

virtual ICppWorker::~ICppWorker (  )  [inline, virtual]

Destructor.


Member Function Documentation

virtual const char* ICppWorker::className (  )  [pure virtual]

Returns the name of the worker class.

Override this method to return the name of your worker class as specified in the pu.xml file.

For example:
virtual const char* className() { return "ExampleWorker"; }

Returns:
Name of the worker class.

virtual bool ICppWorker::Destroy (  )  [pure virtual]

Called prior to the worker becoming eligible for unload.

Override this method to place any cleanup code.

Returns:
Return value is currently ignored

virtual bool ICppWorker::Initialize ( IWorkerPeer Host  )  [pure virtual]

Holds any initialization code.

The method is called upon successful load of the worker via the SBA container. Override this method to include any initialization required.

Parameters:
Host - The reference back to the Host Container
Returns:
Return value is currently ignored

virtual CommandObjectPtr ICppWorker::run ( CommandObjectPtr  work  )  [pure virtual]

Executes the worker's processing code.

Override this method and place here any processing done by the worker.

The method is called by the host container when work is available for the worker. The worker performs the work described within the CommandObject argument. This argument also provides the space Id so that the worker can retrieve the space proxy by calling SpaceFinder::attach. The worker return a results CommandObject back to the caller which can indicate the success of the work performed.

Parameters:
work - The Command that should be processed.
Returns:
CommandObject that holds the results of the work
See also:
CommandObject


Generated on Thu Jul 22 08:11:54 2010 for GigaSpaces XAP 10.0 C++ by  doxygen 1.5.3