chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Monks <pmo...@alfresco.com>
Subject OpenCMIS: should Session extend Serializable?
Date Wed, 01 Jun 2011 22:35:25 GMT
G'day everyone,

Creating an org.apache.chemistry.opencmis.client.api.Session is quite an expensive operation
(it typically takes several seconds), so I'm looking to cache Session objects in a per-user
cache in my client app so that I don't have to recreate Sessions for every single interaction
with the CMIS server.

Unfortunately the cache library I'm using requires that cached objects implement java.io.Serializable,
which Session does not.  However the default implementation class (org.apache.chemistry.opencmis.client.runtime.SessionImpl)
does in fact implement Serializable, allowing me the workaround of casting the Session object
to Serializable prior to adding to the cache.  I'm not particularly comfortable with this
approach however, given that this seems to be an implementation detail and not officially
part of the contract for Sessions.

Is there a compelling reason that Session doesn't implement Serializable?  Is this something
that could be added (noting that this change is backwards compatible)?

Thanks in advance,
Peter


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message