RE: Enums and other serialization woes

From: Jason Stiefel <jasons@xxx.net>
Date: Tue Oct 25 2005 - 09:40:10 PDT

On the client side you can use the HessianProxyFactory to handle this:

        HessianProxyFactory hpf = new HessianProxyFactory();
        hpf.getSerializerFactory().addFactory(new SerializerFactory());
        try {
            proxy = (Client)hpf.create(Client.class, url);
        } catch (MalformedURLException e) {
            throw new ClientException(e);
        }

As for the server-side, I use Spring to wire my serializer factory into the
HessianSkeleton.

-----Original Message-----
From: owner-hessian-interest@xxx.com
[mailto:owner-hessian-interest@xxx.com]On Behalf Of Andrus Adamchik
Sent: Tuesday, October 25, 2005 12:27 PM
To: hessian-interest@xxx.com
Subject: Re: Enums and other serialization woes

Sure, but this leads to the need of subclassing everything else that
may internally create Input/Output. That's no big deal, just breaks
certain level of encapsulation that I wanted to keep. Oh well...

Andrus

On Oct 25, 2005, at 11:52 AM, Jason Stiefel wrote:
> There sure is. I wrote my own factory, but you might want to adjust
> the way
> you implement this. Basically you set the SerializerFactory into your
> HessianInput and/or HessianOutput instances:
>
> -------
>
> HessianInput in = new HessianInput(request.getInputStream());
> in.getSerializerFactory().addFactory(serializerFactory);
>
> HessianOutput out = new HessianOutput(response.getOutputStream());
> out.getSerializerFactory().addFactory(serializerFactory);
>
Received on Tue 25 Oct 2005 09:40:10 -0700

This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:16:41 PDT