开发者

Writing custom session store for Weblogic

I want to store JSP session data in a custom store (the one I specify) in WebLogic server. Is there any interface or base class that I can implement or an filter that I can write that can I can plug-in through configuration and which enables me to store session data in my store? I have done some initial search but couldn't find any entry point. Anyone who have any idea how this can be done.

Actually I wanted to use a store that has good performance and support partitioning data across multiple server (not replicating). There are many such stores (cache's) available. So by writing my session store 开发者_开发百科provider I can store the session data in my partitioned (or partitioned with replication) store, and share them across multiple web servers.


WebLogic has no public API to take control of session data.

If you are willing to do a lot of work, you can modify the web applications to intercept all the session calls and store data where you want. There are standard APIs available: ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener, and HttpSessionAttributeListener. You can register your listeners in web.xml.

If you're ambitious, you can write code to automatically instrument the web apps. Oracle CoherenceWeb product takes this approach. See the section "How the CoherenceWeb Installer instruments a Java EE application" on this page. It gives a high level description of the necessary steps.


I don't think that Weblogic allows you to do that. To my knowledge, there is no publicly available interface to implement and Weblogic doesn't offers any hook or way to plug your implementation in the persistent session configuration.

To be honest, I'm really wondering why you would implement your own persistent store (this is more a responsibility of the application server provider). I don't get what you can't achieve using one of the 5 existing implementation. Maybe you could use a file store and set a custom persistent-store-dir. But actually, without more details on your goal, I'm not sure to be able to point the right direction.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜