indexing description: "[ Test for Eiffel-GigaSpaces wrapper loosely based on POCO benchmark example ]" status: "See notice at end of class." legal: "See notice at end of class." date: "$Date$" revision: "$Revision$" deferred class BENCHMARK inherit BENCHMARK_PARAMETERS EGS_SPACE_FINDER EGS_SHARED_EXCEPTION_HANDLER EXCEPTION_MANAGER_FACTORY feature space_proxy: EGS_SPACE_PROXY space_proxy_cache: EGS_SPACE_PROXY init (a_space_proxy: EGS_SPACE_PROXY) is do space_proxy := a_space_proxy if is_using_local_cache then space_proxy.clean handle_exception space_proxy_cache.clean else space_proxy.clear (Void, Void) end handle_exception space_proxy.snapshot (create_new_object_template) handle_exception rescue handle_raised_exception (exception_manager.last_exception) retry end set_space_proxy_cache (a_proxy: EGS_SPACE_PROXY) is do space_proxy_cache := a_proxy end create_new_object_template: BENCHMARK_BASE_OBJECT is -- Creates new template object for benchmark deferred ensure result_not_void: Result /= Void end create_new_object_for_benchmark: BENCHMARK_BASE_OBJECT is -- Creates new object for benchmark deferred ensure result_not_void: Result /= Void end create_benchmark_object_from_entry (an_entry: EGS_ENTRY): BENCHMARK_BASE_OBJECT is -- "Casts" the EGS_ENTRY object to the instance of the correspondig Eiffel -- benchmark object. Returns Void if casting is not possible, -- or if an_entry is Void deferred end update_object (an_object: BENCHMARK_BASE_OBJECT; index: INTEGER) is -- Updates the object data for update test require an_object_not_void: an_object /= Void deferred end feature {NONE} initialize_parameters (parameters: BENCHMARK_PARAMETERS) is do set_url (parameters.url) set_local_cache_remote_url (parameters.local_cache_remote_url) set_warmups (parameters.warmups) set_repeats (parameters.repeats) set_iterations (parameters.iterations) set_threads (parameters.threads) set_payload_size (parameters.payload_size) set_batch_size (parameters.batch_size) set_object_type (parameters.object_type) set_transaction_mode (parameters.transaction_mode) set_using_local_cache (parameters.is_using_local_cache) end handle_exception is -- Test and clear the possible exception occured do if was_exception then print ("%TException occured, ExceptionName = ") print (last_exception.name) print ("%N") clear_exception end end handle_raised_exception (an_exception: EXCEPTION) is -- Handle the raised XAP exception local xap_exception: EGS_XAP_EXCEPTION do xap_exception ?= an_exception if xap_exception /= Void then print ("%TException occured, ExceptionName = " + xap_exception.name + "%N") clear_exception end end feature indexing 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