Forums de discussion

Unable to unregister Push on Android with a custom session impl (issue)

thumbnail
Denis Signoretto, modifié il y a 7 années.

Unable to unregister Push on Android with a custom session impl (issue)

Expert Publications: 375 Date d'inscription: 21/04/09 Publications récentes
Hi,

I'm facing a problem on Android. nregistering a device for push. I'm using a custom Session implementation.

I've seen that constructor of Push.java class creates a new instance of session object instantiating a new SessionImpl instead of using passed object.

_session = new SessionImpl(session);


I think this is an issue supporting different or extensions of Session. Do you agree? Is there a particular reason why Push constructor needs to create a new object?

Bye,
Denis.
thumbnail
Bruno Farache, modifié il y a 7 années.

RE: Unable to unregister Push on Android with a custom session impl (issue)

Liferay Master Publications: 603 Date d'inscription: 14/05/07 Publications récentes
I think it's just because it needs a clean session, with no callback set. Maybe you can extend Push and override this?
thumbnail
Denis Signoretto, modifié il y a 7 années.

RE: Unable to unregister Push on Android with a custom session impl (issue)

Expert Publications: 375 Date d'inscription: 21/04/09 Publications récentes
Hi Bruno,

our problem with Push class is that we are loosing heasders previously setted in the Session object. We've tried extending Push without success because constructor calls super which initialize Session with a new instance. We've found a workaround implementing our customizations in a Authentication.

It would be desiderable that SessionImpl(Session session) constuctor copy headers as well (or as alternative implement clone() method for Session and use it in Push constructor).

WDYT?

Bye,
Denis.
thumbnail
Bruno Farache, modifié il y a 7 années.

RE: Unable to unregister Push on Android with a custom session impl (issue)

Liferay Master Publications: 603 Date d'inscription: 14/05/07 Publications récentes
I see, we can just make it simpler and not clone the session, as you have suggested previously. Does it work for you?
thumbnail
Denis Signoretto, modifié il y a 7 années.

RE: Unable to unregister Push on Android with a custom session impl (issue)

Expert Publications: 375 Date d'inscription: 21/04/09 Publications récentes
Hi Bruno,

I think creating a new session object is a good choice because Push needs to alter it setting the callback (it would be safe to support multi-thread).
To keep it simple it should be sufficient that SessionImpl(Session session) constructor initialize headers too.

Bye,
Denis.