You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2009/09/25 20:22:16 UTC

[jira] Commented: (SLING-1126) Support serializable objects

    [ https://issues.apache.org/jira/browse/SLING-1126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12759674#action_12759674 ] 

Felix Meschberger commented on SLING-1126:
------------------------------------------

Me thinks, that this is a very interesting idea, but ... ;-)

I see two issues with deserialization:

  (1) I would only support deserialization for the ValueMap.get(String, Class<T>) case where the deserialization can be handled cas the fall back case if the type is none of the defined types in JCR and the property is a binary.

  (2) Classloading. This is probably the harder of the problems to solve. And I have now real clue on how to solve this issue -- other than creating some custom class loader which is able to ask PackageAdmin for bundles providing the required classes ...

> Support serializable objects
> ----------------------------
>
>                 Key: SLING-1126
>                 URL: https://issues.apache.org/jira/browse/SLING-1126
>             Project: Sling
>          Issue Type: Improvement
>          Components: JCR
>    Affects Versions: JCR Resource 2.0.4
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: JCR Resource 2.0.6
>
>
> The JcrPropertyMap and JcrModifiablePropertyMap only support reading and writing the object types supported by JCR. It is currently not possible to store any serializable objects.
> Supporting the writing of serializable objects is easy, we just have to enhance the JcrModifiablePropertyMap to write the serialized object into the repository (through an ObjectOutputStream).
> Reading a serialized object is more tricky as the implementation does not know in advance, if the input stream contains a serialized object or some arbitrary data.
> The check for this is a little bit expensive as it would require to first try to read the data through an ObjectInputStream and if that success we have the serialized object. If this is not successful, a new input stream has to be used.
> As I think that this is a very valuable feature (for example the Sling eventing has a use case for this), we should do this special check only under certain circumstances, for example
> a) if ValueMap.get(KEY) is invoked and  the property is an input stream
> or
> b) if ValueMap.get(KEY, Object.class) is used
> Any other ideas, suggestions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.