indexing description: "[ The common interface that is used when working with data events. listeners can be registered using the add_listener methods and receive an EGS_EVENT_REGISTRATION that will be used to unregister using the remove_listener when a listener is detroyed it automaticaly unregister. ]" legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" revision: "$Revision$" class EGS_DATA_EVENT_SESSION inherit EGS_EVENT_SESSION create make_from_external feature add_listener (template: EGS_ENTRY; listener: EGS_REMOTE_EVENT_LISTENER; timeout: INTEGER_64; action_types: INTEGER): EGS_EVENT_REGISTRATION is -- Registers a listener with a space using a template -- @param template - EGS_ENTRY template used for matching. -- @param listener - user defined listener implementing EGS_REMOTE_LISTENER -- @param timeout - the time duration in which the listener will be receiving calls. -- @param actionTypes - the type of actions you wish to receive notification on, see EGS_NOTIFY_MODIFIERS -- -- @return the EGS_EVENT_REGISTRATION object. require was_not_exception: not was_exception template_not_void: template /= Void listener_not_void: listener /= Void local res: POINTER do listener.start res := cpp_add_listener (exception_handler, object_ptr, template.object_ptr, listener.object_ptr, timeout, action_types) if res /= default_pointer then create Result.make_from_external (res) end end remove_listener (registration: EGS_EVENT_REGISTRATION) is -- Unregisters the listener from the space. -- -- @param registration the registration object received from the server when the listener was added. -- @see add_listener require was_not_exception: not was_exception registration_not_void: registration /= Void do cpp_remove_listener (exception_handler, object_ptr, registration.object_ptr) end close is -- closes the session and unregister all listeners. do cpp_close (exception_handler, object_ptr) end feature {NONE} -- externals cpp_add_listener (eh: EGS_EXCEPTION_HANDLER; obj_ptr: POINTER; template: POINTER; listener: POINTER; timeout: INTEGER_64; action_types: INTEGER): POINTER is require eh_not_void: eh /= Void obj_ptr_not_null: obj_ptr /= default_pointer template_not_null: template /= default_pointer listener_not_null: listener /= default_pointer external "C++ inline use " alias "[ try { return new OpenSpaces::EventRegistrationPtr((*((OpenSpaces::DataEventSessionPtr*)$obj_ptr))->addListener((OpenSpaces::IEntry*)$template, (OpenSpaces::IRemoteEventListener *)$listener, $timeout, $action_types)); } catch(OpenSpaces::XAPException& e) { EGS_HANDLE_XAP_EXCEPTION($eh, e); return 0; } ]" end cpp_remove_listener (eh: EGS_EXCEPTION_HANDLER; obj_ptr: POINTER; registration: POINTER) is require eh_not_void: eh /= Void obj_ptr_not_null: obj_ptr /= default_pointer registration_not_null: registration /= default_pointer external "C++ inline use " alias "[ try { (*((OpenSpaces::DataEventSessionPtr*)$obj_ptr))->removeListener(*((OpenSpaces::EventRegistrationPtr*)$registration)); } catch(OpenSpaces::XAPException& e) { EGS_HANDLE_XAP_EXCEPTION($eh, e); } ]" end cpp_close (eh: EGS_EXCEPTION_HANDLER; obj_ptr: POINTER) is require eh_not_void: eh /= Void obj_ptr_not_null: obj_ptr /= default_pointer external "C++ inline use " alias "[ try { (*((OpenSpaces::DataEventSessionPtr*)$obj_ptr))->close(); } catch(OpenSpaces::XAPException& e) { EGS_HANDLE_XAP_EXCEPTION($eh, e); } ]" end cpp_delete (obj_ptr: POINTER) is external "C++ inline use " alias "delete ((OpenSpaces::DataEventSessionPtr*)$obj_ptr)" end indexing library: "egigs-cpp: Library for accessing the GigaSpaces platform, POCO library based implementation." copyright: "Copyright (c) 2008, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software 356 Storke Road, Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end