views:

116

answers:

2

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.

A: 

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.

Pascal Thivent
Sorry, I should have added it to my question. I have updated the question.
cornerback84
A: 

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 Coherence*Web product takes this approach. See the section "How the Coherence*Web Installer instruments a Java EE application" on this page. It gives a high level description of the necessary steps.

David G

related questions