I have developed some liferay portlets with Vaadin. My Application class implements PortletRequestListener, thus having onRequestStart(PortletRequest request, PortletResponse response) and onRequestEnd(PortletRequest request, PortletResponse response) methods. I have some general questions on the lifecycle of a portlet.
I’m missing a “destroy” method as a counterpart to “init”. Where is the best place to do some clean up when the session has ended i.e. the user has logged out etc.
By now, I fetch user information with the PortletRequest object. I have recognized that ‘onRequestStart()’ gets called before the application’s ‘init()’ method. Actually this is what I want, but shouldn’t it be the opposite way? ‘init()’ first, then ‘onRequestStart()’?
Thanks for your answer, but isn’t the close() method just for shutting down the application manually? I don’t think it is called when the application stops.
I’m searching for a kind of listener which gets called when the user session ends (timeout, logout from liferay, etc) to do some cleanup.
Close is for both, see it as some equivalent to a destructor from C.
You can put System.out.println(“in close”) and see if it appears in your terminal when the session is destroyed.