Change HazelcastClusteringAgent#init method to include the following and
see whether the sysouts are getting printed.

primaryHazelcastConfig.addMapConfig(mapConfig);

        SerializerConfig sc = new SerializerConfig();
        sc.setImplementation(new StreamSerializer<TreeSet<Long>>() {
            @Override
            public void write(ObjectDataOutput objectDataOutput,
TreeSet<Long> longs) throws IOException {
                System.out.println("TreeSet StreamSerializer#write called");
            }

            @Override
            public TreeSet<Long> read(ObjectDataInput objectDataInput)
throws IOException {
                System.out.println("TreeSet StreamSerializer#read called");
                return null;
            }

            @Override
            public int getTypeId() {
                return 0;
            }

            @Override
            public void destroy() {
                System.out.println("TreeSet StreamSerializer#destroy
called");
            }
        }).setTypeClass(new TreeSet<Long>().getClass());

primaryHazelcastConfig.getSerializationConfig().addSerializerConfig(sc);


On Mon, Dec 8, 2014 at 3:00 PM, Sajini De Silva <saj...@wso2.com> wrote:

> Still its working.
>
> On Mon, Dec 8, 2014 at 2:54 PM, Afkham Azeez <az...@wso2.com> wrote:
>
>>
>> On Mon, Dec 8, 2014 at 2:50 PM, Sajini De Silva <saj...@wso2.com> wrote:
>>
>>> SerializerConfig sc = new SerializerConfig()
>>>                 .setImplementation(new TreeMapSerializer())
>>>                 .setTypeClass(new TreeSet<Long>().getClass());
>>>         Config config = new Config();
>>>         config.getSerializationConfig().addSerializerConfig(sc);
>>>         HazelcastInstance primaryHazelcastInstance=
>>> Hazelcast.newHazelcastInstance(config);
>>>         IMap<String, TreeSet<Long>> testMap =
>>> primaryHazelcastInstance.getMap("testMap");
>>>
>>>         TreeSet<Long> slotIdSet = new TreeSet<Long>();
>>>         slotIdSet.add(Long.valueOf(1212121));
>>>         slotIdSet.add(Long.valueOf(3413131));
>>
>>
>>
>> Change the code as follows & see whether it still works. Most probably it
>> won't work:
>>
>> SerializerConfig sc = new SerializerConfig()
>>                 .setImplementation(new TreeMapSerializer())
>>                 .setTypeClass(new TreeSet<Long>().getClass());
>>         Config config = new Config();
>>
>>         HazelcastInstance primaryHazelcastInstance= Hazelcast.
>> newHazelcastInstance(config);
>>         IMap<String, TreeSet<Long>> testMap = primaryHazelcastInstance.
>> getMap("testMap");
>>         config.getSerializationConfig().addSerializerConfig(sc);
>>
>>         TreeSet<Long> slotIdSet = new TreeSet<Long>();
>>         slotIdSet.add(Long.valueOf(1212121));
>>         slotIdSet.add(Long.valueOf(3413131));
>>
>>
>> --
>> *Afkham Azeez*
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; http://www.apache.org/
>> * <http://www.apache.org/>*
>> *email: **az...@wso2.com* <az...@wso2.com>
>> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
>> *http://blog.afkham.org* <http://blog.afkham.org>
>> *twitter: **http://twitter.com/afkham_azeez*
>> <http://twitter.com/afkham_azeez>
>> *linked-in: **http://lk.linkedin.com/in/afkhamazeez
>> <http://lk.linkedin.com/in/afkhamazeez>*
>>
>> *Lean . Enterprise . Middleware*
>>
>
>
>
> --
> Sajini De SIlva
> Software Engineer; WSO2 Inc.; http://wso2.com ,
> Email: saj...@wso2.com
> Blog: http://sajinid.blogspot.com/
> Git hub profile: https://github.com/sajinidesilva
>
> Phone: +94 712797729
>
>


-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* <http://www.apache.org/>*
*email: **az...@wso2.com* <az...@wso2.com>
* cell: +94 77 3320919blog: **http://blog.afkham.org*
<http://blog.afkham.org>
*twitter: **http://twitter.com/afkham_azeez*
<http://twitter.com/afkham_azeez>
*linked-in: **http://lk.linkedin.com/in/afkhamazeez
<http://lk.linkedin.com/in/afkhamazeez>*

*Lean . Enterprise . Middleware*
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to