[infinispan-dev] Adding isMarshallable() to Marshaller interface?
Manik Surtani
manik at jboss.org
Tue Jul 27 06:14:51 EDT 2010
On 27 Jul 2010, at 11:10, Galder Zamarreño wrote:
>
> On Jul 27, 2010, at 0:05 PM, Manik Surtani wrote:
>
>>
>> On 27 Jul 2010, at 10:12, Galder Zamarreño wrote:
>>
>>> Hi,
>>>
>>> Re: https://jira.jboss.org/browse/ISPN-552
>>>
>>> This came from the user forum (http://community.jboss.org/message/554531#554531). I had originally thought of removing the if statement in MV ctor but that's not a good idea since it can delay discovery and in single node envs it won't detect the problem. Instead of hardcoding what the marshaller can do in MV ctor, I suggest adding a isMarshallable method to Marshaller interface. More details in JIRA.
>>
>> Why the Marshaller interface? Every impl would essentially answer isMarshallable() in the same way, regardless of the implementation, right?
>
> Not all. GenericJBossMarshaller + TestObjectStreamMarshaller would reply with:
>
> return (o instanceof Serializable || o instanceof Externalizable);
>
> However, JBossMarshaller needs to take in account @Marshallable objects that it learns from the ConstantObjectTable, so its impl would be:
>
> return (o instanceof Serializable || o instanceof Externalizable || || ReflectionUtil.isAnnotationPresent(o.getClass(), Marshallable.class));
Right, makes sense. Ok, +1.
--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org
More information about the infinispan-dev
mailing list