Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
Huy Ho
How to access portlet context from Scheduler class?
19 de agosto de 2008 7:01
Respuesta

Huy Ho

Ranking: Regular Member

Mensajes: 177

Fecha de incorporación: 18 de abril de 2006

Mensajes recientes

I have a Scheduler class that implements com.liferay.portal.job.Scheduler in one of my portlets. This scheduler class wakes up every few minutes and perform a webservice request to update data. This data is to be made available for all other portlets to share and use. My problem is that I don't know how to make this data available to the portlets. The first place I can think of is the portlet context, but I don't know how to access the context from my scheduler class. Anyone have any idea?

As of right now, I am dumping this xml file to the server, and the portlets read in the xml file when it wants to get an updated data. But this is obviously not efficient, especially if the data gets large. One other option I thought of is maybe to have a table in the database to store this data, and other portlets can query the database to get the result. But I don't really like this option considering that the data is very volatile, changing from minutes to minutes. I'd like to just keep it in memory.
Ray Augé
Re: [Liferay Forums][3. Development] How to access portlet context from Sch
18 de agosto de 2008 20:48
Respuesta

Ray Augé

LIFERAY STAFF

Ranking: Liferay Legend

Mensajes: 1206

Fecha de incorporación: 7 de febrero de 2005

Mensajes recientes

Neil Griffin recently wrote a blog post just for you. emoticon


http://www.liferay.com/web/ngriffin/blog/-/blogs/sharing-data-between-portlets


HTH!
Adjunto

archivos adjuntos: stock_smiley-1.png (0,9k)