Carsten Ziegeler wrote:
Sylvain Wallez wrote:
I'm currently a little bit confused. We have a store, a transient!!!!! A LogicSheet cannot be Serializable !!!!!
It extends AbstractLogEnabled and has attributes of type ServiceManager and SourceResolver, which aren't serializable !
Furthermore, I don't understand why LogicSheets go to JCS since the transient store is used (see AbstractMarkupLanguage.service())
Don't have much time ATM, but looking at the recent changes I see a JCSTransientCache. We must be *very careful* with transient cache being actually transient, i.e. *not requiring objects to be serializable*.
If JCS requires objects to be serializable even without a persistent backend, so let's *not use it* for the transient cache, and keep the previous MRU memory store.
And please, please, do not make Serializable objects that intrinsically are not. This is the root of many evils.
store and a persistent store, right?
I was confused also when I dived into the store stuff :-)
So, we can make the MemoryStore the transient store (no data
is serialized) and we can make JCS the persistent store (this
requires the objects to be serializable which is ok).
What about the "simple store"?
The transient store (role Store.TRANSIENT_STORE) is used for objects that are not serializable, or whose storage doesn't make sense across server restart. The transient store lives on its own and has no relation with other stores. This is a mandatory component within Cocoon (i.e. used by Cocoon's code).
The store (role Store.ROLE) is used to store objects that are serializable. As the transient store, it is a mandatory component.
Some store (Store.ROLE) implementations (but not all) may actually be just an in-memory cache that swap objects by calling the persistent store (Store.PERSISTENT_STORE) when needed. So transient store is an _optional_ component which is used only by MRUMemoryStore, and _nowhere else_ in the code. When using JISP, we had this mechanism : the store was a MRUMemoryStore swapping to the persistent store which was a JISPStore.
To sum up :
- Store.TRANSIENT_STORE : used by Cocoon to store non-serializable objects
- Store.ROLE : used by Cocoon to store serializable objects
- Store.PERSISTENT_STORE : optional component that _may_ be used by in-memory implementations of Store.ROLE to delegate persistent storage.
AFAIU, JCS has its own in-memory front end to the persistent storage. In this configuration Store.ROLE will be a JCSStore and Store.PERSISTENT_STORE will have no implementation (because we don't need it).
But we still and will always need a TRANSIENT_STORE that doesn't require objects to be serializable. If JCS cannot handle this, then let's keep the current DefaultTransientStore (which extends MRUMemoryStore).
Hope this clear things a bit.
Ah, and one more detail: it would be good for JCS*Store source files to be in the "impl" directory.
Sylvain
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
