You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by "Hensley, Richard" <Ri...@McKesson.com> on 2004/10/20 23:03:58 UTC
Blending HiveMind Services and POJO's
I have an authenticate hivemind service. The job of that service is to
return an implementation of the User interface.
The User implementation is not a hivemind object, it is a POJO. The User
implementation requires another hivemind service to return a list of
values when requested. This is all easy up to this point because the
authenticate method can inject the required services into the User
implementation at construction time. Now comes the problem. The User
implementation is Serializable, references to services are transient
properties of the User implementation, so how does the User implementation
reacquire references to the services after being serialized and
deserialized.
Right now I have basically implemented static global access to the hivemind
registry.
Is there a better way?
Richard
---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
Re: Blending HiveMind Services and POJO's
Posted by Howard Lewis Ship <hl...@gmail.com>.
Can you control where and how the User objects are serialized. You
could use the substituion support when serializing to serialize a
token representing your user. If you can control the deserializing,
you can subtitute back in an equivalent User.
On Wed, 20 Oct 2004 17:03:58 -0400, Hensley, Richard
<ri...@mckesson.com> wrote:
> I have an authenticate hivemind service. The job of that service is to
> return an implementation of the User interface.
>
> The User implementation is not a hivemind object, it is a POJO. The User
> implementation requires another hivemind service to return a list of
> values when requested. This is all easy up to this point because the
> authenticate method can inject the required services into the User
> implementation at construction time. Now comes the problem. The User
> implementation is Serializable, references to services are transient
> properties of the User implementation, so how does the User implementation
> reacquire references to the services after being serialized and
> deserialized.
>
> Right now I have basically implemented static global access to the hivemind
> registry.
>
> Is there a better way?
>
> Richard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>
>
--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org