If you manage the state externally, you can even use a singleton service (unless the service provides non-concurrent access to a resource).
I will scan the archives and try to make a proposal on the wiki.


- Andreas


Harish Krishnaswamy wrote:
Ofcourse! The only way to use it right now is to keep the state in the session and the behavior in services! Search the mailing list archives (I think it'll be in jakarta commons dev archives) for the ideas that Geoff came up with.

-Harish

Andreas Winter wrote:

I think, this doesn't work. The service is associated with the thread. The
same thread could start a different session when the next request comes in, which would result in sharing the service between my session and the newly
created. Even using the HiveMindFilter wouldn't help since it releases the service to the pool as soon as the request finishs. I think, as soon as I
have learned to work with the Wiki ;-), I start a discussion or design
proposal.


- Andreas




Yes, Geoff has been playing with this idea a while back. You may want to start a discussion on the wiki. For now, I suppose you can get the pooled service and store it in the session yourself?

-Harish

Andreas Winter wrote:



Not really, the "pooled" service model is a variant of the thread service
model. Pooling is a concept which could be used with every service model,
although it doesn't make much sense in the case of a singleton based
service.


- Andreas






There is also a "pooled" service model which is what you want.

-Harish

Andreas Winter wrote:



Hi,

as far as I understand, HiveMind supports two service models, one based

on


the singleton pattern (one service per classloader), and one based on

the


current thread (one service per thread).

I would suggest an extension of this model, where these two are special
cases:


Simple allow to get service from the registry based on a

client-provided


object, ie. add a API like

getService(Object ref, String servicePoint, Class serviceClass)

to the registry.

I came around with this, when I tried to get a separate service for

each


HTTPSession in a web application, which seems impossible with the

current


models.

Maybe it is also useful to provide a special API to provide

configuration


contributions programmatically.

Just some proposals
Andreas






--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to