indexing description: "[ Encapsulates a Jini Lease object ]" legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" revision: "$Revision$" class EGS_LEASE create make_from_external feature -- Constants forever: INTEGER_64 = 2147483647 -- Used to request a lease that never expires any_Lease: INTEGER_64 = -1 -- Indicates that there is no particular lease time desired. -- The effective duration will be the same as Forever feature -- Creation make_from_external (obj_ptr: POINTER) is -- require obj_ptr_not_null: obj_ptr /= default_pointer do expiration_time := cpp_get_expiration_time (obj_ptr) uid := cpp_get_uid (obj_ptr); end feature -- Queries uid: STRING -- The UID of the lease object expiration_time: INTEGER_64 -- A value that indicates the time that the lease will expire. -- This time is represented as milliseconds from the beginning of the epoch, -- relative to the local clock. feature {NONE} -- externals cpp_get_uid (obj_ptr: POINTER): STRING_8 is -- Get the Uid from `obj_ptr'. require obj_ptr_not_null: obj_ptr /= default_pointer external "C inline use %"egigs.h%"" alias "[ /* Use a helper routine so that there is no conflict with the C memory allocator * and the Hoard one used by Gigaspace. */ EIF_INTEGER count = lease_get_uid_length ($obj_ptr); EIF_REFERENCE result; char *l_str = (char *) malloc (count * sizeof(char) + 1); if (l_str) { lease_get_uid($obj_ptr, count, l_str); l_str[count] = '\0'; result = RTMS_EX(l_str, count); free(l_str); } else { /* Raise an out of memory exception. */ result = NULL; enomem(); } return result; ]" end cpp_get_expiration_time (obj_ptr: POINTER): INTEGER_64 is require obj_ptr_not_null: obj_ptr /= default_pointer external "C++ inline use " alias "((OpenSpaces::Lease*)$obj_ptr)->getExpiration()" 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