Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #1006 (new)

Opened 16 years ago

Last modified 15 years ago

Document and possibly implement helper method for reattaching to a serialized stateful server

Reported by: jamoore Owned by: jamoore
Priority: minor Milestone: Unscheduled
Component: Documentation Version: 3.0-M1
Keywords: ice, proxies, sessions Cc:
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: n.a.
Sprint: n.a.

Description

It is possible to reconnect both to a session as well as a stateful service in that session via Ice. This is, however, not documented anywhere.

#
# Create on client and a stateful search service
#
client = omero.client()
sess = client.createSession()
sess.getQueryService().findAll("Image",None)
search = sess.createSearchService()

#
# Record information from the service
#
seralized = str(search)
category = search.ice_getIdentity().category

#
# In a separate process or later on...
#
client_2 = omero.client()
sess_2 = client_2.createSession(category, category)
prx = client_2.ic.stringToProxy(serialized)
search_2 = omero.api.SearchPrx.checkedCast(prx)

#
# Now it is possible to work with the same stateful service.
#
search_2.onlyType("Image") 

Change History (1)

comment:1 Changed 15 years ago by jmoore

  • Milestone changed from OMERO-Beta4 to OMERO-Beta4-Docs
Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.67677 sec.)

We're Hiring!