You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by Carlin Rogers <ca...@gmail.com> on 2006/05/21 05:49:03 UTC
NameSevice and implementing Serializable (BEEHIVE-1112)
NetUI devs,
I was wondering if you had some thoughts about the NameService class
and support for serialization. See...
http://issues.apache.org/jira/browse/BEEHIVE-1112
I'm not sure that we can actually make NameService Serializable
because the _nameMap HashMap member variable is a map of
WeakReference. Unfortunately, I don't think reference objects are
Serializable. In general you would have the variable that refers to
the reference object be transient in a Serializable class. Otherwise
we'd just get an exception like "java.io.NotSerializableException:
java.lang.ref.WeakReference"
So, any thoughts about how to support the use of NameService (in the
DivPanel and Tree XHR features) in a cluster environment?
Thanks,
Carlin
Re: NameSevice and implementing Serializable (BEEHIVE-1112)
Posted by Carlin Rogers <ca...@gmail.com>.
Yes, I'd thought of that and it will definitely allow NameService to be
Serializable. However, as far as the features using the NameService, I was
concerned that it might not be a good idea to make the map transient. For
example, when a TreeRootElement is added to the NameService (to support
XmlHttpRequest handling and running the tree on the client) and
serialization occurs, there's no way to get that back from the deserialized
NameService. Seems like that would be an issue in a clustered container env.
On 5/21/06, Thomas Cook <th...@gmail.com> wrote:
>
> Can _nameMap itself be transient, and if so would that solve this
> problem? It seems like you might be able to get away with making a
> hash map full of weak references transient.
>
>
> On 5/20/06, Carlin Rogers <ca...@gmail.com> wrote:
> > NetUI devs,
> >
> > I was wondering if you had some thoughts about the NameService class
> > and support for serialization. See...
> >
> > http://issues.apache.org/jira/browse/BEEHIVE-1112
> >
> > I'm not sure that we can actually make NameService Serializable
> > because the _nameMap HashMap member variable is a map of
> > WeakReference. Unfortunately, I don't think reference objects are
> > Serializable. In general you would have the variable that refers to
> > the reference object be transient in a Serializable class. Otherwise
> > we'd just get an exception like "java.io.NotSerializableException:
> > java.lang.ref.WeakReference"
> >
> > So, any thoughts about how to support the use of NameService (in the
> > DivPanel and Tree XHR features) in a cluster environment?
> >
> > Thanks,
> > Carlin
> >
>
Re: NameSevice and implementing Serializable (BEEHIVE-1112)
Posted by Thomas Cook <th...@gmail.com>.
Can _nameMap itself be transient, and if so would that solve this
problem? It seems like you might be able to get away with making a
hash map full of weak references transient.
On 5/20/06, Carlin Rogers <ca...@gmail.com> wrote:
> NetUI devs,
>
> I was wondering if you had some thoughts about the NameService class
> and support for serialization. See...
>
> http://issues.apache.org/jira/browse/BEEHIVE-1112
>
> I'm not sure that we can actually make NameService Serializable
> because the _nameMap HashMap member variable is a map of
> WeakReference. Unfortunately, I don't think reference objects are
> Serializable. In general you would have the variable that refers to
> the reference object be transient in a Serializable class. Otherwise
> we'd just get an exception like "java.io.NotSerializableException:
> java.lang.ref.WeakReference"
>
> So, any thoughts about how to support the use of NameService (in the
> DivPanel and Tree XHR features) in a cluster environment?
>
> Thanks,
> Carlin
>