Use the advanced SED storable to store data on disk (rather than the runtime storable)

This commit is contained in:
Jocelyn Fiat
2013-03-08 15:34:04 +01:00
parent f280f9b0de
commit 0d9e1a84f3
3 changed files with 29 additions and 4 deletions

View File

@@ -72,7 +72,7 @@ feature -- Persistence
if not f.exists or else f.is_writable then if not f.exists or else f.is_writable then
f.create_read_write f.create_read_write
a_session.data.set_expiration (a_session.expiration) a_session.data.set_expiration (a_session.expiration)
f.general_store (a_session.data) storage.store (a_session.data, create {SED_MEDIUM_READER_WRITER}.make_for_writing (f))
f.close f.close
end end
end end
@@ -106,6 +106,11 @@ feature -- Persistence
feature {NONE} -- Implementation feature {NONE} -- Implementation
storage: SED_STORABLE_FACILITIES
once
create Result
end
data_from_file (f: FILE): detachable like session_data data_from_file (f: FILE): detachable like session_data
require require
f.is_open_read and f.is_readable f.is_open_read and f.is_readable
@@ -114,7 +119,7 @@ feature {NONE} -- Implementation
do do
if if
not rescued and then not rescued and then
attached {like session_data} f.retrieved as d attached {like session_data} storage.retrieved (create {SED_MEDIUM_READER_WRITER}.make_for_reading (f), True) as d
then then
Result := d Result := d
end end
@@ -157,4 +162,14 @@ feature {NONE} -- Implementation
Result := fn.string Result := fn.string
end end
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
5949 Hollister Ave., Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end end

View File

@@ -78,12 +78,12 @@ feature -- Control
deferred deferred
end end
apply_to (h: HTTP_HEADER; a_request: WSF_REQUEST; a_path: detachable READABLE_STRING_8) apply_to (h: HTTP_HEADER; req: WSF_REQUEST; a_path: detachable READABLE_STRING_8)
deferred deferred
end end
note note
copyright: "Copyright (c) 1984-2012, Eiffel Software and others" copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -27,4 +27,14 @@ feature -- Persistence
deferred deferred
end end
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
5949 Hollister Ave., Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end end