IRemoteEventListener Interface Reference

Inherited by IRemoteEventListenerBoostWrapper< T >.

List of all members.


Detailed Description

This interface is the pure virtual interface for notification events.

Customer classes must derive from this interface and implement the notify member in order to receive events from the space.

Sample usage:

Here is an example of using DataEventSession for registring a listener over matching entries:


 // The Listener class for a Person entry
 class PersonNotifyListener : public IRemoteEventListener 
 {
 public:
 // Constructor
 PersonNotifyListener() : m_counter(0) {};

 	// Interface
 	int getCounter() 
 	{
 		ACE_Guard<ACE_Mutex> guard(m_mtx);
 		return m_counter; 
 	};

 	// Implement IRemoteEventListener method
 	virtual bool notify( const RemoteEvent& remoteEvent )
 	{
 		IEntryPtr temp(remoteEvent.getIEntry());
 		// Make the code thread-safe because the underlying infrastructure is implemented
 		// using multi-threading so this code is most likely to be accessed by multiple threads.
 		ACE_Guard<ACE_Mutex> guard(m_mtx);

 		m_counter++;
 		return true;
 	}

 	// Data
 private:
 	int m_counter;
 	ACE_Mutex m_mtx;
 };

 

See also:
IRemoteEventListener,EventSessionFactory,EventSessionConfig,DataEventSession,EventSession,EventRegistration,RemoteEvent
Customer classes must derive from this interface and implement the notify member in order to receive events from the space.

See also:
DataEventSession

Public Member Functions

virtual bool notify (const RemoteEvent &remoteEvent)=0

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